I am creating a 2D Unity game similar to Flappy Bird, but with enhanced mechanics, UI, and monetization features.
The main character is a winged number 1, and the gameplay includes obstacles, power-ups, shields, and coins.
- Use the Modular Component Pattern (MCP) to structure the project:
- Each major game feature should be handled by its own script/component.
- Scripts should not overlap responsibilities.
- Use clean, inspector-driven serialized fields.
- Use events or messaging for inter-component communication.
- Design UI panels, buttons, icons, characters, and obstacles in Canva with cartoon style.
- Export all visuals as PNG files with transparent backgrounds.
- Import into Unity as
Sprite (2D and UI)and organize under:
Assets/ ├── Sprites/ │ ├── Characters/ │ ├── UI/ │ ├── PowerUps/ │ └── Obstacles/ ├── Scripts/ │ ├── Player/ │ ├── UI/ │ ├── Obstacles/ │ ├── PowerUps/ │ ├── Managers/ │ └── Ads/ ├── Prefabs/ ├── Animations/ ├── Audio/ └── Scenes/
yaml Copy Edit
- Assign Canva assets to GameObjects and prefabs.
- Animate wings, bubbles, and collisions using AnimatorController.
- UI should be managed via
UIManager.cs.
- Create
PlayerController.cs. - Add flap mechanic (on touch or spacebar).
- Use Rigidbody2D + rotation tilting.
- Animate wing flap on every jump.
- Add collision detection.
- Create
OperatorBubbleprefab that:- Moves leftward and up/down (sine wave).
- Has animated wings and a label (e.g.,
+1,x0).
- On collision:
- Apply operation to number.
- End game if
x0unless shield is active.
- Destroy off-screen.
- Create
Mine(moves up/down + leftward) andPipe(static). - Animate mines.
- Destroy off-screen.
- Colliding ends game unless shield is active.
- Create
Shieldprefab (random floaty motion). - Collectible by player.
- Protects from 1 hit (mine, pipe,
x0). - Visual shield bubble around player.
- Track shield count globally using PlayerPrefs or JSON.
- Create
Coinprefab with random floaty movement. - Collecting 3 coins grants 1 shield.
- Display total coins in UI and track globally.
- Create animated Game Over panel:
- Score
- High score (persistent)
- Coins collected
- Shields
- Add restart button and animation.
- Add pause/resume functionality.
- Use
UIManager.csto manage UI panels.
- Add
LevelManager.cs. - Increase level based on score/time.
- Increase game speed, bubble spawn rate.
- Decrease spawn frequency of shields/coins.
- Increase chance of
x0bubbles.
- Add:
- Magnet: Pulls in nearby coins/shields.
- Slow Motion: Slows time temporarily.
- Shrink: Reduces size.
- Invincibility: Immune to obstacles temporarily.
- Create system for:
- Daily challenges
- Missions like “Collect 10 coins”
- Display and reward with coins or shields.
- Use cartoon-style sprites from Canva.
- Animate:
- Wing flaps
- Collisions
- Shield pickups
- Add:
- Score multiplier bubbles
- Combo bonuses
- Juicy feedback: screen shake, pop FX, sound FX
- Add parallax scrolling backgrounds.
- Add dynamic soundtrack (faster as level increases).
- Add:
- Unlockable numbers (2, 3, 4...) with different wings
- Name input for leaderboard
- Share score button
- Global leaderboards (if online support added)
- In-app purchases:
- 5 shields for $0.05
- Coin doubler
- Remove ads
- Ad system:
- Interstitial ads every 3–4 restarts
- Banner ads (top or bottom)
- Rewarded ads for shield or revive
- Pause menu with resume/restart/exit.
- Settings menu (music, SFX, language).
- Onboarding/tutorial for first-time players.
- Save coins, shields, highscores via PlayerPrefs or persistent file.
- Offline support for core gameplay and purchases when possible.
- Use clean modular scripts:
PlayerController,GameManager,UIManager,AdManager, etc. - Organize all assets by type (Sprites, Scripts, Prefabs, Audio).
- Use
publicfields with[SerializeField]for flexibility. - Favor modularity and single responsibility per script.
- Use
Events,UnityEvent, or C# delegates to keep decoupling between modules.
Follow this full structure and order to develop the game, using Copilot suggestions, Unity's 2D system, and Canva-designed visuals. Prioritize code clarity and feature completion one step at a time.
- Unity 2D (C#). Build a game inspired by Flappy Bird starring a winged number
1, plus unlockable Cat, Dog, Fox. - Use PNG sprites from
Assets/Spritesfor all visuals. - Implement: operator bubbles, mines, pipes, shields, coins, power-ups, leveling, starter screen, shop, game over panel, data persistence.
- Create wing + feet animations: wings flap for characters, power-ups, and winged obstacles; feet move on characters.
- Copilot must create the animations, controllers, prefabs, scenes, and hierarchy exactly as specified below.
- All PNGs live in
Assets/Sprites/. - For every sprite:
- Texture Type: Sprite (2D and UI)
- Filter Mode: Point (or Bilinear)
- Compression: Automatic
- Pixels Per Unit: 100
- Mesh Type: Full Rect
- Pivot: Center
Assets/
├── Sprites/ # All provided PNGs
├── Animations/
│ ├── Wings/
│ └── Feet/
├── Controllers/
│ ├── WingAnimator.controller
│ └── FeetAnimator.controller
├── ScriptableObjects/
│ └── DefaultFlapProfile.asset
├── Prefabs/
│ ├── Characters/
│ │ ├── Number1.prefab
│ │ ├── Cat.prefab
│ │ ├── Dog.prefab
│ │ └── Fox.prefab
│ ├── Powerups/
│ │ ├── Magnet.prefab
│ │ ├── Slowdown.prefab
│ │ ├── Coin.prefab
│ │ └── Shield.prefab
│ └── Obstacles/
│ ├── Mine.prefab
│ └── Pipe.prefab
├── Scripts/
│ ├── Animation/ # (Controllers & runtime will use these)
│ ├── Gameplay/
│ ├── Managers/
│ ├── UI/
│ ├── Scene/
│ └── Editor/
└── Scenes/
├── Start.unity
├── Game.unity
└── Demo.unity
- Create
DefaultFlapProfile.assetatAssets/ScriptableObjects/. - Properties and defaults:
restAngle = 0minAngle = -12(loop lower bound)maxAngle = 12(loop upper bound)flapFrequency = 6(Hz for looping items)flapImpulseTime = 0.18(total in+out for player flaps)feetKickMultiplier = 1
Create clips with appropriate keyframes and easing:
Assets/Animations/Wings/Wing_Flap_In.anim- Rotate Z:
rest → -35°in 0.08s, ease-out.
- Rotate Z:
Assets/Animations/Wings/Wing_Flap_Out.anim- Rotate Z:
-35° → restin 0.10s, ease-in.
- Rotate Z:
Assets/Animations/Wings/Wing_Looping.anim- Rotate Z oscillation between
minAngle..maxAnglecontinuously. Speed driven by a parameter (see below).
- Rotate Z oscillation between
Assets/Animations/Feet/Feet_Kick.anim- Small Z rotation ±6° or small Y bob (±0.02) for 0.18s total. Ease in/out.
Assets/Controllers/WingAnimator.controller- Parameters:
Flap(Trigger)FlapSpeed(Float)Looping(Bool)
- States:
- If
Looping == true: stay in Wing_Looping (loop). - Else:
Idle→ (onFlap) Wing_Flap_In → Wing_Flap_Out →Idle.
- If
- Parameters:
Assets/Controllers/FeetAnimator.controller- Parameters:
Kick(Trigger)
- States:
Idle→ (onKick) Feet_Kick →Idle.
- Parameters:
- Characters (Number1, Cat, Dog, Fox):
- Wings flap when player flaps (impulse); optional low-rate idle flutter when not flapping.
- Feet do a short kick synchronized with wing flap.
- Power-ups (Magnet, Slowdown, Coin, Shield) and Mine:
- Wings flap in loop mode at constant frequency (use
Looping = trueandFlapSpeed = flapFrequency).
- Wings flap in loop mode at constant frequency (use
- Slight left/right desync: offset wings by ~0.01–0.03s for organic feel (randomized is fine).
Each winged prefab must have these children (empty GameObjects with SpriteRenderers):
RootPrefab
├── Body (SpriteRenderer) # main sprite from Assets/Sprites
├── LeftWing (SpriteRenderer + Animator: WingAnimator)
└── RightWing (SpriteRenderer + Animator: WingAnimator)
- Place LeftWing and RightWing pivots near wing hinges (shoulder area).
- Sorting: wing SpriteRenderers slightly above Body (e.g., sortingOrder +1).
- Number1.prefab, Cat.prefab, Dog.prefab, Fox.prefab
- Children: LeftWing, RightWing, plus LeftFoot, RightFoot (feet use FeetAnimator).
- Assign
WingAnimator.controllerto wings;FeetAnimator.controllerto feet. - Add a component (your naming) to:
- Trigger
Flapon both wing animators when the player flaps. - Trigger
Kickon both feet simultaneously. - Optionally set low-rate idle wing flutter.
- Trigger
- Magnet, Slowdown, Coin, Shield
- Children: LeftWing, RightWing (WingAnimator).
- Set
Looping = trueand setFlapSpeedfrom profile (around 6 Hz). - Motion: gentle float/random drift + leftward travel if spawned in-game.
- Mine: winged, up/down bobbing + leftward movement. Looping wing flap.
- Pipe: static sprite (no wings), moves leftward; get destroyed off-screen.
Hierarchy:
Main Camera (Orthographic, size ~5, sky-blue background)
Canvas (Screen Space - Overlay)
├── StartScreen (Panel)
│ ├── Title
│ ├── HighestScoreText
│ ├── CharacterCarousel
│ │ ├── PrevButton
│ │ ├── CharacterPreview (Image)
│ │ └── NextButton
│ ├── PlayButton
│ ├── ShopButton
│ └── CoinsCounter
└── ShopPanel (Panel, initially inactive)
├── ShopTitle
├── BuyShieldButton (cost label)
├── BuyMagnetButton (optional)
├── BuySlowdownButton (optional)
└── CloseButton
EventSystem
Behavior:
- HighestScoreText reads from persistence.
- CharacterCarousel cycles between Number1/Cat/Dog/Fox and persists selection.
- PlayButton loads Game.unity (or hides Start UI and starts the run).
- ShopButton toggles ShopPanel.
- CoinsCounter shows persistent coin total.
Hierarchy:
Main Camera (Orthographic)
ParallaxBackground (optional layers)
GameRoot
├── Spawners
│ ├── PipeSpawner
│ ├── BubbleSpawner
│ ├── PowerupSpawner
│ └── MineSpawner
├── PlayerSpawn (Transform at ~(-2, 0))
└── Managers
├── GameManager
├── LevelManager
├── UIManager
└── SaveSystem (or singleton/utility)
Canvas (Screen Space - Overlay)
├── HUDPanel
│ ├── ScoreText
│ ├── CoinsText
│ └── ShieldIndicator
└── GameOverPanel (inactive)
├── ScoreText
├── HighScoreText
├── TotalPowerupsText
├── RestartButton
└── HomeButton
EventSystem
Behavior:
- On scene start, instantiate selected character at
PlayerSpawn. - Hook player flap input → trigger wings/feet animation impulses.
- Spawners create pipes, bubbles, mines, and power-ups with speeds/difficulty from LevelManager.
- Off-screen cleanup for all movers.
- HUD shows live Score & Coins.
- On death: show GameOverPanel with score, high score, total power-ups earned. Buttons restart or go home.
- Simple playground showing one character plus a few winged power-ups and a mine with looping wings, for quick visual checks.
- Tap/click/space → add upward velocity (Flappy-style) and impulse wing+feet animation.
- Tilting/rotation reacts to velocity.
- Move left; oscillate vertically (sine).
- Show label (
+1,-1,x0,/2, etc.) over bubble. - On collision:
- Apply operation to current player number/value.
- If
x0and no active shield → Game Over.
- Despawn off-screen.
- Pipe: fixed; gaps vary; despawn off-screen.
- Mine: leftward + vertical bobbing; looping wing flap; collision ends game unless shielded.
- Shields: floaty pickup. On collect, gain 1-hit protection against pipe/mine/
x0. - Coins: floaty pickup; 3 coins = 1 shield (configurable).
- Persist coin total and shield count globally.
- Magnet: pulls nearby coins/shields towards player.
- Slow Motion: slows time or obstacle speed briefly.
- Shrink (optional): smaller collider.
- Invincibility (optional): brief immunity.
- All winged power-ups loop wings constantly.
- Difficulty increases with score/time:
- Increase game speed and spawn rates.
- Increase frequency of
x0bubbles. - Decrease frequency of shields/coins.
- Start Screen (default): Highest score, character select, Play, Shop, Coins counter.
- Shop: buy power-ups with coins (e.g., Shield cost 3 coins). Update totals and persist.
- HUD: Score, Coins, Shield status while playing.
- Game Over Panel: Score, Highest Score (update/persist), Total Power-Ups Earned (session + lifetime), Restart, Home.
Coins(int)Shields(int)HighScore(int)TotalPowerups(int)SelectedCharacterId(int) — 0:Number1, 1:Cat, 2:Dog, 3:Fox
- IAP products: 5 shields ($0.05), Coin Doubler, Remove Ads.
- Ads:
- Interstitial every 3–4 restarts.
- Banner at top or bottom.
- Rewarded: revive or add 1 shield.
- Keep these stubbed and modular (no vendor lock-in now).
- Wings flap:
- Impulse on player flap for characters.
- Looping at constant frequency for power-ups and mine.
- Feet kick exactly during player’s wing impulse.
- Slight L/R desync for natural feel.
- Animator parameter names must match:
- Wings:
Flap(Trigger),Looping(Bool),FlapSpeed(Float) - Feet:
Kick(Trigger)
- Wings:
- All Animator Controllers & Clips created at the exact paths above.
- Start.unity contains: StartScreen UI (with HighestScoreText, CharacterCarousel, Play, Shop), ShopPanel UI (inactive default), and CoinsCounter. Buttons wired.
- Game.unity contains: full hierarchy (Managers, Spawners, PlayerSpawn, HUD, GameOverPanel). Selected character instantiates at runtime.
- Demo.unity contains: a quick test layout with one character and looping winged items.
- All prefabs in
Assets/Prefabs/...created and assigned sprites fromAssets/Sprites. - Off-screen cleanup works for movers (bubbles, pipes, mines, power-ups).
- Data persists (coins, shields, high score, selected character).
- Strict Modular Component Pattern (MCP):
- Gameplay logic, animation control, UI management separated.
- Use serialized fields for Inspector tuning.
- Use events/delegates for inter-system messaging (no hard coupling).
- No magic numbers in code; read tunables from the profile or Inspector.
- Keep the Inspector wiring clear and consistent across prefabs.
- Create folders and import sprites.
- Create animation clips and animator controllers (names/paths above).
- Create the DefaultFlapProfile.asset with default values.
- Build prefabs: Characters, Power-ups, Obstacles (children, animators, references).
- Build Start.unity (full UI + wiring).
- Build Game.unity (full hierarchy, spawners, managers, HUD, GameOver).
- Build Demo.unity (quick inspection scene).
- Verify animation behavior, UI flow, and persistence using the acceptance criteria.
Implement exactly as written.