Fox Studios logo Fox StudiosGame projects, devlogs and Scratch builds
Projects

How We Built a Flappy Bird Game in Scratch in a Week

Most tutorials for a Flappy Bird game in Scratch stop at "make the bird fall and the pipes move," and then you are left with a game that feels floaty, unfair or both. We hit that wall on our first attempt.

A laptop screen showing a colorful side scrolling bird game with green pipes, a sketchbook of level notes beside it on a desk

Most tutorials for a Flappy Bird game in Scratch stop at "make the bird fall and the pipes move," and then you are left with a game that feels floaty, unfair or both. We hit that wall on our first attempt. The bird drifted like a balloon, pipes overlapped, and players died on collisions that never touched the sprite.

This devlog covers the version we finished over one week of evenings, roughly 9 hours in total. It runs at a steady 30 frames per second in the browser, has a score and a best score, and our playtesters went from rage quitting in 10 seconds to asking for "one more try." Here is how we built it and what we would change.

Planning the Flappy Bird game in Scratch before touching a block

We wrote the whole design on one index card. That was on purpose. As we argued in why your first game should be tiny, scope is what kills small projects, and Flappy Bird is the perfect test because the rules fit in one sentence.

  • One input: space bar or mouse click makes the bird flap.
  • Gravity pulls the bird down every frame.
  • Pipe pairs scroll from right to left with a fixed gap.
  • Passing a pipe adds 1 point. Touching a pipe or the ground ends the run.

Three sprites: Bird, Pipe and Ground. Four variables: y velocity, score, best score and game state. That was the whole plan.

Making the bird feel right

The bird is where the game lives or dies. Our first build changed y by a fixed amount when you clicked, which felt mechanical. The fix was a simple velocity variable.

  1. Create a variable called y velocity for this sprite only.
  2. In a forever loop, change y velocity by -1, then change y by y velocity.
  3. When space is pressed, set y velocity to 9. Do not add to it. Setting it is what makes every flap feel the same.
  4. Clamp falling speed: if y velocity is less than -12, set it to -12. Without this, the bird falls so fast near the ground that players cannot react.

We tested flap values from 7 to 12. At 7 the bird struggled to climb a gap, at 12 it rocketed into the ceiling. 9 with gravity of -1 felt closest to the original rhythm.

Tilting the sprite

A small detail that made a big difference: point in direction (90 minus y velocity times 3). The bird noses up on a flap and dives as it falls. It is one block, and three of our five testers mentioned it without being asked.

Spawning pipes with clones

We reused the clone pattern from our snake game in Scratch, where each body segment is a clone of one sprite. Here, each pipe pair is a single clone.

  • Draw one costume that contains both the top and bottom pipe with a transparent gap in the middle. Our gap is 120 pixels tall on a 360 pixel stage.
  • The parent Pipe sprite hides itself and creates a clone every 1.6 seconds.
  • When a clone starts, go to x 260 and a random y between -80 and 80. That moves the gap up and down.
  • Each clone changes x by -4 every frame and deletes itself when x is less than -260.

Putting both pipes in one costume solved our overlap bug instantly. Two separate sprites drifted out of sync whenever the frame rate dipped. One costume cannot drift.

Scoring without double counts

Our first scoring check added a point while the pipe's x was between -10 and 10, which counted 3 to 5 points per pipe. The fix: give each clone a "for this sprite only" variable called scored, set it to 0 on start, and add 1 to score only when x drops below the bird's x and scored is still 0. Then set scored to 1.

Why pixel perfect collision made the game worse

The usual advice is to use "touching Pipe" on the bird and call it done, since Scratch checks the actual painted pixels. It sounds fair. In practice, it made our game feel cheap.

The bird's wing tip sticks out 3 or 4 pixels on the flap frame. Players would clip a pipe corner with a wing and die on something they could not see at full speed. Every tester called those deaths unfair.

Our fix was a separate invisible hitbox costume: a plain circle about 80 percent of the bird's size. The bird switches to the hitbox costume, checks for touching Pipe or Ground, then switches back to the drawn costume, all inside one frame so nothing flickers. Run the forever loop in a custom block with "run without screen refresh" ticked to keep it clean.

Deaths went from "that was rubbish" to "that was my fault." Generous hitboxes are a standard trick in commercial games for exactly this reason.

Game states, best score and polish

We used one variable, game state, with three values: ready, playing and over. Every script checks it before acting. This stopped pipes spawning on the title screen, which had been our longest running bug.

  • Ready: bird bobs in place, a "click to flap" message shows.
  • Playing: gravity on, pipes spawn, score counts.
  • Over: pipes freeze, the bird drops to the ground, best score updates if score is higher.

The scrolling ground is two copies of one costume moving at -4 per frame, the same speed as the pipes. If the ground and pipes move at different speeds, players notice immediately even if they cannot explain why. We used the same looping trick in our endless runner built in Scratch over one weekend.

What we would change next time

Speed should ramp up slowly. Right now the game is as hard at pipe 40 as at pipe 4. A future version would shorten the spawn timer by 0.02 seconds every 10 points, with a floor of 1.1 seconds. We would also add a sound on scoring, since testers said they lost count during tense runs.

Frequently asked questions

How do you make a Flappy Bird game in Scratch?

Use a bird sprite with a velocity variable for gravity and flapping, and a pipe sprite that creates clones with a random gap height. Each clone scrolls left and deletes itself off screen. Add a score check per clone and a game state variable to control the start and end screens.

Why does my Scratch bird fall too fast?

You are probably changing y velocity every frame with no limit. Add a check that keeps y velocity from going below about -12. Lowering gravity from -1 to -0.8 also helps if the game feels too heavy.

How long does it take to make Flappy Bird in Scratch?

A basic playable version takes 1 to 2 hours if you know clones and variables. A polished version with fair collisions, game states and a best score took us about 9 hours over a week. Most of that time went into tuning feel, not writing blocks.

DF
Diego Fenn

Diego covers finished builds and the community around them, and runs the feedback threads that shape what the studio makes next.

More posts by Diego

More in Projects

01doorganico 084goad 3hot8 4465456 after5internprogram ahandfulofblessings ahmadpc ahomcybersecurity allodialresources annodex antiquesandperiodcollectibles aotc asianworldkashmir beedlectrics bloggertemplatefree bluefeatheragency bodyweightsolution campaign08blog carfixadvisor catstreetcollective cbstvsports cnfanspurchasing committeeof500yearsofdignityandresistance covertopsdjs cs-kaiyuangame cuestacomunicaciontotal cxoutlet dancebetgame deskgearhub destinyvillastay detectmagazine di33 diamondsteelbuildings donmo dyanadropship emarsysfinance emimattl escapechan eskitarih evautoplay everythingweddings-orlando farmzone feedviewerapp gamevui123 gleasongrade greetingsday hacklabasu haskell iw-kaiyun jagoanproperti jilidskripsi joltbusinessfinance juegodepokergratis juegospucca kaeru-festival latestmehndidesigns lestanzediottaviano litemagazines localcommunityhero lustrsazan mariashebets menswheels newwebstechs1 nikkit ootheday oxigenvpn plurfitness prefetial probudgetcarpetcleaning psychicmrsmartin pyaten qvantor rejoignezlogis rexzbot riselayouts ruchin rwxqsgd5 sakaltime shibiaowang shop-bot skrtips spotlesshaven strcoding tetapatrium topselller uneplanteartificielle vipertechcr webtech1223411 wo-kygaming yamaha-mekar yeknava yoybuysheets zenunwa yamaha-mekar jilidskripsi ankertoto ankertoto ankertoto