I was bored on a Sunday morning, so I decided to make a flappy bird program. I was following a tutorial because I don't know how to use the graph screen (yet). However, I came upon a bug in the collision detection, and I can't find where it is. As soon as the game loop begins, the program detects the "Bird" on top of its self and ends the program.
Code:
I am really new to all of this, so a pointer would be appreciated.
Code:
PlotsOff
FnOff
GridOff
AxesOff
0->Xmin
264->Xmax
0->Ymin
164->Ymax
ClrDraw
0->S
Lbl P
For(I,1,4
randInt(80,134)->R
For(J,1,26)
60I+J->A
Line(A,164,A,R,14)
Line(A,R-45,A,0,14)
End:End
17->X
82->Y
4->W
X->P
Y->Q
Pt-On(X,Y,2,19)
Pt-On(X,Y,1,11)
getKey->K
Repeat K=105 or K=25
getKey->K
If K=22:Return
End
"GAME LOOP
Repeat K=22
getKey->K
If K=105 or K=25:12->W
W-3->W
X+4->X
Y+W->Y
If Y<0 or Y>164
Goto GO
Pt-Off(P,Q,2)
Pt-Off(P,Q,1)
Pt-On(X,Y,2,19)
Pt-On(X,Y,1,11)
If pxl-Test(164-Y,X)
Goto GO
X->P:Y->Q
If X=85 or X=145 or X=205 or X>259
Then
S+1->S
Text(0,1220S
If X>259
Goto P
End
Lbl GO
Pt-On(X,Y,2,19)
Pt-On(X,Y,1,11)
TextColor(11)
Text(70,100," GAME OVER
Text(84,100," SCORE: "
Text(84,150,S
Pause
End
I am really new to all of this, so a pointer would be appreciated.