Discuss Scratch

monkey2012halfpint
Scratcher
0 posts

How do make a flappy bird game

How do you make a flappy bird game can I have some code help
kiwilover2736
Scratcher
1000+ posts

How do make a flappy bird game

There are various tutorials on YouTube, so i'd recommend searching for one. You can always also check already existing Flappy Bird games here on Scratch!
Zenocker
Scratcher
9 posts

How do make a flappy bird game

Look at some tutorials! They’re basically everywhere.
Just look it up on google/YouTube.

Here’s the first video I found when searching on google:
https://www.youtube.com/watch?v=WNElB_uppNQ
(Not advertisement)
OsomKoolGuy
Scratcher
78 posts

How do make a flappy bird game

you can use some code like this to get the bird to work:
whenclickedforeverifmousedown?thenchangeyby10changeyby-10whenclickedforeveriftouchingsprite1?thenstopall
Then for the pipes you can use
whenclickedforeverrepeatuntiltouchingedge?gotox:-200y:0changexby-10
You could program a velocity system for the bird if you know how instead of the more simple approach given
youormeletsbringit
Scratcher
69 posts

How do make a flappy bird game

You can get an idea from the code in my project https://scratch.mit.edu/projects/1000104964
abubriski
Scratcher
500+ posts

How do make a flappy bird game

whenclickedforeverchangeyVby-1changeybyyV
whenclickedforeverifkeyspacepressed?thensetyVto5waituntilnotkeyspacepressed?
abubriski
Scratcher
500+ posts

How do make a flappy bird game

abubriski wrote:

whenclickedforeverchangeyVby-1changeybyyV
whenclickedforeverifkeyspacepressed?thensetyVto5waituntilnotkeyspacepressed?
And for the pipes:
whenclickedgotox:240y:0foreverwaitpickrandom3to10secscreatecloneofmyself
whenIstartasacloneglide5secstox:-240y:0deletethisclone

Last edited by abubriski (June 5, 2024 12:11:32)

PointerOS_software
Scratcher
35 posts

How do make a flappy bird game

monkey2012halfpint wrote:

How do you make a flappy bird game can I have some code help
Just put this code on the bird sprite:
whenclickedforeverifnotkeywhichever keypressed?thenrepeatuntilverticalvelocity=0change vertical velocityby-1elseset vertical velocityto5

you can increase the vertical velocity value in the else branch to increase the speed of falling. Also you can rearrange the code so as to omit the “not” operator if u want.

follow this code by:

whenclickedforeverchangeybyverticalvelocity

then go to the obstacle sprite and you can make some clones scripts for the obstacles and if then clone touching bird, broadcast death, game over.
PointerOS_software
Scratcher
35 posts

How do make a flappy bird game

OsomKoolGuy wrote:

you can use some code like this to get the bird to work:
whenclickedforeverifmousedown?thenchangeyby10changeyby-10whenclickedforeveriftouchingsprite1?thenstopall
Then for the pipes you can use
whenclickedforeverrepeatuntiltouchingedge?gotox:-200y:0changexby-10
You could program a velocity system for the bird if you know how instead of the more simple approach given
The mouse down script could be abused and players could just hold onto the mouse button instead of clicking in an order, also changing Y this drastically will make way for some choppy movements.
ayushdel_test
Scratcher
1 post

How do make a flappy bird game

Bird code -
whenclickedsetgravityto0setcanIto1foreverchangeybygravitychangegravityby-1iftouchingobs?thensetgravityto-10setcanIto0iftouchingedge?thensetcanIto0
when spacekeypressedifcanI=1thensetgravityto10wait.1secs

obs-
whenclickedsetscoreto0ifcanI=1thensetytopickrandom80to-80gotox:290y:yglide1secstox:-290y:yifnotcanI=0thenchangescoreby1

Last edited by ayushdel_test (June 6, 2024 10:03:36)

abubriski
Scratcher
500+ posts

How do make a flappy bird game

PointerOS_software wrote:

OsomKoolGuy wrote:

you can use some code like this to get the bird to work:
whenclickedforeverifmousedown?thenchangeyby10changeyby-10whenclickedforeveriftouchingsprite1?thenstopall
Then for the pipes you can use
whenclickedforeverrepeatuntiltouchingedge?gotox:-200y:0changexby-10
You could program a velocity system for the bird if you know how instead of the more simple approach given
The mouse down script could be abused and players could just hold onto the mouse button instead of clicking in an order, also changing Y this drastically will make way for some choppy movements.
That's why I made sure to do it this way (I am not @OsomKoolGuy):

abubriski wrote:

whenclickedforeverchangeyVby-1changeybyyV
whenclickedforeverifkeyspacepressed?thensetyVto5waituntilnotkeyspacepressed?

Powered by DjangoBB