Games & fun

Build a game app with AI

A native arcade game build brief for a one-thumb tap-to-fly game with a fair difficulty curve, a saved high score and a share button.

Apirex TeamUpdated AndroidiOS
On this page
  1. Screens
  2. Data model
  3. Native features
  4. Android notes (Kotlin and Jetpack Compose)
  5. iPhone notes (Swift and SwiftUI)
  6. Copy-paste prompt
  7. Acceptance test
  8. Frequently asked questions
5screens
3data tables
179word prompt
2platforms: Android, iOS

A small arcade game is the most fun way to learn what a native app feels like: one thumb, instant restarts and a score you want to beat. This brief describes a tap-to-fly game where a paper plane climbs with each tap, drifts down under gravity and dodges stacks of coffee cups that scroll in from the right. It suits Android first, drawn with a Compose Canvas, and the same loop works on iPhone with SwiftUI Canvas or SpriteKit; the iPhone build needs a Mac with Xcode. The proof is simple: play three rounds, beat your score once and see it survive a restart.

Screens

  • Title: Show the best score, a Play button and a sound toggle
  • Game: Run the flight loop with score in the corner and pause on interruption
  • Game over: Show this run, the best run and a big Play again button
  • Scores: List the last twenty runs with date and distance
  • Settings: Control sound, vibration and an easier practice mode

Data model

Arcade game records
TableKey fieldsPurpose
runsid (uuid), score (int), duration_ms (int), ended_at (timestamptz), mode (text)Every finished round, so best score is derived from history
settingsid (int), sound_on (bool), haptics_on (bool), practice_mode (bool)Player preferences remembered between launches
level_tuningversion (int), gravity (real), flap_impulse (real), gap_min (real), speed_step (real)Named physics values so difficulty changes are deliberate and testable

Everything stays on the phone: runs in Room or SwiftData, settings in DataStore or AppStorage. Store each run and compute the best score from it, rather than overwriting a single number, so a crash mid-save cannot wipe a record. A global leaderboard is a separate project; if you add one later, connect your own Supabase and validate scores on the server, because any number submitted straight from a phone can be faked.

Native features

A game loop has to tie movement to elapsed time, not to how fast a frame happens to arrive, or the plane will fly faster on a 120 Hz screen than on a 60 Hz one. Collision should use simple rectangles that are slightly forgiving, which reads as fair to a player.

FeatureAndroid (Kotlin)iPhone (SwiftUI)Notes
Frame loopwithFrameNanos inside a LaunchedEffect driving Canvas stateTimelineView(.animation) with Canvas, or SpriteKit update(_:)Scale every movement by delta time and clamp large gaps after a pause.
FeedbackHapticFeedbackConstants or Vibrator with a short effectUIImpactFeedbackGenerator on tap and crashRespect the haptics setting and system silent modes.
Sharing a scoreACTION_SEND with plain textShareLink with a short messageShare text only; no screenshots of other games or brand art.

Android notes (Kotlin and Jetpack Compose)

Hold plane position, velocity, obstacle list and score in a ViewModel-owned state object, and advance it from a frame callback that receives nanoseconds. Draw the sky, plane and cups in a single Canvas so recomposition does not rebuild a tree of composables every frame.

  • Pause automatically in onPause and when the window loses focus, then show a three-second countdown before resuming. A paused run must never count distance or register a crash.
  • Insert a run into Room exactly once when the game ends, guarded by a game state enum so a double collision on the same frame cannot write two records.
  • On a real Android phone, play with battery saver on, which can lower the refresh rate, and confirm the plane covers the same distance per second. Rotate the device on the title screen and during play to confirm the chosen orientation lock holds.

iPhone notes (Swift and SwiftUI)

For a first version, TimelineView with Canvas is enough and keeps the game in pure SwiftUI; switch to SpriteKit only if you later need particle effects or many sprites. Keep simulation in an @Observable model that advances from the timeline date, separate from drawing code.

  • Listen to scenePhase and pause when the app goes inactive, for example when a call or Control Centre interrupts play.
  • Save finished runs with SwiftData and show the best score with a query sorted by score, so the title screen and game over screen always agree.
  • Test on a physical iPhone with ProMotion and an older 60 Hz model if available. Tap rapidly during the crash animation and confirm only one run is saved and Play again starts a clean round.

Copy-paste prompt

Build this yourself 177 words · Android
Make a tap-to-fly arcade game where a paper plane dodges coffee cups, with a high score that beats my friend's.
Build it as a native Android game with screens Title, Game, Game over, Scores and Settings. Tapping gives the plane a lift; gravity pulls it down. Stacks of coffee cups scroll in from the right with a gap to fly through, and speed rises a little every ten points. Tie all movement to elapsed time so it plays the same on 60 Hz and 120 Hz screens, and use slightly forgiving rectangle collisions. Save every finished run locally and derive the best score from saved runs. Add sound and vibration toggles and a practice mode with wider gaps.
Pause automatically when the app is interrupted and resume after a short countdown. Use original simple shapes and colours, no copied game art or names. Show an empty Scores state before the first run. For acceptance, play three rounds, beat the best score once, close and reopen the app, and confirm the best score and run list are unchanged.

Opens Apirex with this prompt in the box. Pick the Android · Kotlin tab before you send.

Acceptance test

  1. Start a round, tap to climb, and confirm the plane falls when you stop tapping.
  2. Crash into a cup on purpose and verify the Game over screen shows this score and the stored best.
  3. Play until the speed step triggers twice and check that obstacles move faster while the gap remains passable.
  4. Leave the app during a round, come back and confirm the game paused with a countdown and no extra distance.
  5. Force-close after setting a new best, reopen and confirm the best score and the Scores list both show it once.

Difficulty is where these games feel fair or cheap. Write down the gravity, lift and gap values that feel right in practice mode and normal mode, then replay with those exact numbers after any change. A player who dies within two seconds of every start is a tuning bug, not a skill problem.

Frequently asked questions

Can I make it look like a famous mobile game?

Keep the art, name and sounds original. The tap-to-fly mechanic is a common genre, but logos, characters and recognisable assets from existing games should not be copied.

Will a high score sync between my phones?

Not in this version. Scores are local. A shared leaderboard needs your own Supabase project and server-side checks so scores cannot be typed in by hand.

Is a game engine required?

No. A Compose Canvas on Android and SwiftUI Canvas on iPhone handle a two-dimensional arcade game well. SpriteKit is an option on iPhone if you add many effects.

Build this blueprint

The blueprint prompt, ready for your platform. Edit anything before you send it.

AndroidKotlin · Jetpack ComposeReal source on your computer

Opens Apirex with this prompt. Pick the Android · Kotlin tab before you send. The Free plan includes 5 Rex Credits a day.