-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFlappyBird.bpp
74 lines (51 loc) · 1.27 KB
/
FlappyBird.bpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
///FLAGS:-r
rem preparing functions
rem setting up the screen
poke ///framecolor///, ///black///
poke ///bgcolor///, ///black///
poke ///txtcolor///, ///white///
///clear///
rem bird is at x=12
///,birdx=1036
///,birdxcolor=55308
///,jumpheight=5
///,emptychar=96
///,bird=62
///,birdcolor=7 rem set the bird color to yellow
///,maxgravity=2
by%=13
py%=by%
s%=0
print " press fire to start "
poke ///birdxcolor///+by%*40,///birdcolor///
poke ///birdx///+by%*40,///bird///
rem read start input
///.asktobegin
if peek(56320)=111 then goto gamebegin
if peek(56321)=239 then goto gamebegin
goto asktobegin
///.gamebegin
///clear///
poke ///birdxcolor///+by%*40,///birdcolor///
poke ///birdx///+by%*40,///bird///
///.cyclestart
rem bird management
///.inputhandler
if peek(56320)=111 then goto jump
if peek(56321)=239 then goto jump
///.changeheight
py%=by%
by%=by%+s%
if by%>24 then by%=24
if by%<0 then by%=0
///.gravity
if s%<///maxgravity/// then s%=s%+1
rem pipe management
///.renderbird
poke ///birdx///+py%*40,///emptychar///
poke ///birdxcolor///+by%*40,///birdcolor///
poke ///birdx///+by%*40,///bird///
goto cyclestart
///.jump
s%=abs(s%)-///jumpheight///
goto changeheight