flappy.py

Created by 4244

Created on August 28, 2025

1014 Bytes

oi


# Type your text here:ClrHome
:ClrDraw
:0X      // vogel x (constant)
:7Y      // vogel y (verticale positie)
:0S      // score
:randInt(8,12)GX  // eerste gaping x
:randInt(1,11)GY  // gaping y (bovenste pixel van gat)
:Repeat getKey(54) // toets [CLEAR] stopt
:ClrDraw
:Text(1,1,"SCORE:"  
:Output(1,8,S)
:For(I,0,83) // tekenen achtergrond (optioneel)
:End
:Locate(1,1)
:For(XP,0,83) // teken buizen: als XP==GX teken verticale kolom met gat GY..GY+3
:If XP=GX
:For(P,0,15)
:If not(PGY and PGY+3)
:Then
:Pt-On(XP,P)
:End
:If XP=GX+20 // maak meerdere buizen verschuiving
:End
:EndFor
: // teken vogel als blok
:Pt-On(10,Y)
: // zwaartekracht + input: toets [2ND]+ (=getKey code 45) of toets 5? we gebruiken key 24 (up)
:If getKey(24)
:Y-2Y
:Else
:Y+1Y
:If Y>15 or Y<0
:Then
:Text(6,1,"GAME OVER")
:Disp "Score:",S
:Pause
:Stop
:End
: // verplaats buizen naar links (we simuleren door GX te verlagen)
:GX-1GX
:If GX<0
:Then
:84GX
:randInt(1,11)GY
:S+1S
:End
:Pause 0.05
:End
:ClrDraw

During your visit to our site, NumWorks needs to install "cookies" or use other technologies to collect data about you in order to:

With the exception of Cookies essential to the operation of the site, NumWorks leaves you the choice: you can accept Cookies for audience measurement by clicking on the "Accept and continue" button, or refuse these Cookies by clicking on the "Continue without accepting" button or by continuing your browsing. You can update your choice at any time by clicking on the link "Manage my cookies" at the bottom of the page. For more information, please consult our cookies policy.