Hey guys! Im making snake on my TI-84 plus.
This is what I have yet:
ClrHome
{0,0,0,0,0→A
{0,0,0,0,0→B
Menu("SNAKE","PLAY",1,"HIGH SCORES",2
Lbl 1
ClrHome
ClrDraw
AxesOff
1→A:0→B:2→D:0→Z:0→X:0→Y
Lbl 3
(int(23.5rand)*4→V
(int(15.5rand)*4→W
While Z=0
Pt-On(V,W,3
If X=V and Y=W
Then
D+1→D
1→Z
Else
End
getKey→K
If K=24
Then
0→B
-1→A
Else
End
If K=26
Then
0→B
1→A
Else
End
If K=25
Then
0→A
1→B
Else
End
If K=34
Then
0→A
-1→B
Else
End
X+A*4→X:Y+B*4→Y
X→⌊A(1+dim(⌊A
Y→⌊B(1+dim(⌊B
⌊A(dim(⌊A)-D→F
⌊B(dim(⌊B)-D→E
Pt-Off(F,E
Pt-Off(F,E,2
Pt-Off(F,E,3
Pt-On(X,Y,2
Pt-On(X,Y
End
0→Z
Goto 3
I could use some help tho, how could I check if the snake is biting in it's tail?
I made it so it would search the list, if it was on the same spot, but it would slow down so much that eventually there was no fun left.
So what I need is an easy pxl-test like thing, or something that scales the list on how long my snake is.
I would appreciate it very much, thanks!
ClrHome:Lbl 0:GetKey->A:If A>0:Then:ClrHome:Output(2,2,A:Goto 0:Else:End:Goto 0