0 Members and 1 Guest are viewing this topic.

:Lbl 1:AxesOff:FnOff :0→Xmin:94→Xmax:0→Ymax:‾62→Ymin:ClrHome:ClrDraw:RecallPic 0:For(X,2,500:End:ClrDraw:Lbl MN:0→P:Menu(" SNAKE ","PLAY",P,"HIGH SCORE",S,"QUIT",Q:Lbl P:Menu(" DIFFICULTY ","EASY",E,"MEDIUM",M,"HARD",H:Lbl E:25→T:1→D:Goto C:Lbl M:50→T:2→D:Goto C:Lbl H:100→T:3→D:Goto C:0→Q:Lbl C:ClrDraw:DelVar L:If P=0:Then:Output(4,5,"PREPARE":Output(5,4,"TO QUALIFY":Else:ClrHome:Output(4,6,"READY":End:Pause :ClrHome:Output(4,6,"1":For(X,2,250:End:Output(4,8,"2":For(X,2,250:End:Output(4,10,"3":For(X,2,250:End:ClrHome:Output(4,7,"GO!!":For(X,2,100:End:ClrDraw:For(X,0,Q:Pxl-On(randInt(1,61),randInt(1,93:End:Horizontal 0:Horizontal ‾62:Vertical 0:Vertical 94:26→R:48→B:32→A:While 1:Repeat pxl-Test(A,B) or L=320:Pxl-On(A,B:L+1→L:getKey:If Ans:Ans→R:B+(R=26)-(R=24→B:A-(R=25)+(R=34→A:End:If L=320:Then:P+1→P:PT→Q:ClrHome:Output(3,4,"CONGRATS!!":Output(4,6,"GO TO":Output(5,5,"LEVEL":Output(5,11,P:Pause :Goto C:End:ClrHome:Output(3,4,"YOU'RE DEAD":Output(4,5,"SCORE:":P*320+L→S:Output(4,11,S:Pause :If S>H and D=3:Then:S→H:Input "NAME:",Str0:End:If S>M and D=2:Then:S→M:Input "NAME:",Str9:End:If S>E and D=1:Then:S→E:Input "NAME:",Str8:End:ClrHome:Lbl S:{E,M,H}→∟SNHS:Output(2,2,"HIGH SCORES":Output(4,1,"E":Output(4,3,Str8:Output(5,1,"M":Output(5,3,Str9:Output(6,1,"H":Output(6,3,Str0:Output(4,10,∟SNHS(1):Output(5,10,∟SNHS(2):Output(6,10,∟SNHS(3):Pause :ClrHome:DelVar P:DelVar Q:DelVar L:Goto MN:Lbl Q

If you'd like a homescreen version, you could try this one: http://tibasicdev.wikidot.com/snake

:128→dim(L1):128→dim(L2):{16,8}→dim([A]):Fill(0,[A]):1→L:1→O:2→N:1→X:2→Y:1→H:0→V:0→B:X→L1(O):Y→L2(O):ClrHome:randInt(1,8)→G:randInt(1+[A](1,G)+[A](2,G),16)→F:Output(G,F,"*"):Repeat B:getKey→A:If A:Then:If A=105:Pause :If V((A=24)+(A=26)):Then:0→V:A-25→H:End:If H((A=25)+(A=34)):Then:0→H:(A=34)-(A=25)→V:End:End:H+X→X:V+Y→Y:If (X=0)+(X=17)+(Y=0)+(Y=9):Then:If X=0 :16→X:If X=17:1→X:If Y=0 :8→Y:If Y=9 :1→Y:End:If [A](X,Y):1→B:If not(B):Then:Output(Y,X,"O"):1→[A](X,Y):X→L1(N):Y→L2(N):N+1-128(N=128)→N:If (X=F)(Y=G):Then:randInt(1,16)→F:randInt(1,8)→G:While [A](F,G):randInt(1,16)→F:randInt(1,8)→G:End:L+1→L:Output(G,F,"*"):Else:0→[A](L1(O),L2(O)):Output(L2(O),L1(O)," "):O+1-128(O=128)→O:End:End:End:ClrHome:Output(2,4,"Game Over!"):Output(5,4,"Score:"):Output(5,11,L):DelVar L1:DelVar L2:DelVar [A]