I've recently made level 1 of a basic platformer game in TI-BASIC. It is relatively small, but the amount of code it goes through makes your character move slower(at bigger intervals). When I first started, I got the character moving pretty fast like I wanted it to, but when I finished adding the rest of the code, the character moved slower, almost like moon-walking (thus the reason I gave the player limited air, lol). I know I could make the character move across the screen at bigger intervals, but I would rather it move by 1 each time. Anyways, can you guys optimize this for speed? Suggestions for adding difficulty is appreciated too.
:ClrDraw :AxesOff :CoordOff :LabelOff :PlotsOff :FnOff :GridOff :0→Xmin:94→Xmax :0→Ymin:62→Ymax :Text(1,1,"GOAL: get to the box! :rand(75 :ClrDraw :Line(0,1,94,1 :Line(0,2,94,2 :Line(40,12,45,12:Line(40,11,45,11 :Line(46,22,51,22:Line(46,21,51,21 :Line(52,32,57,32:Line(52,31,57,31 :Line(58,42,63,42:Line(58,41,63,41 :Line(64,52,94,52:Line(64,51,94,51 :Line(0,62,94,62 :Line(91,53,92,53:Line(91,54,92,54 :Text(1,1,"Air: :Line(13,59,33,59:Line(13,58,33,58:Line(13,57,33,57 :20→X:8→Y:0→θ:33→Z :While θ=0 :13→P:Pt-On(X,Y :Pt-Off(X-2,Y :Pt-Off(X+2,Y :Line(X-1,Y+1,X+1,Y+1,0:Y→B :getKey→K :X-2(K=24 and X≥3)+2(K=26 and X≤91)→X :If K=25:Then :While pxl-Test(61-Y,X)=0 and Y≤B+P:getKey→K :Pt-Off(X,Y :Y+1→Y :X-(K=24 and X≥3 and pxl-Test(62-Y,X-1)=0)+(K=26 and X≤91 and pxl-Test(62-Y,X+1)=0)→X :Z-(randInt(1,15)=1 and Z>12)→Z :Line(Z,57,Z,59,0 :Pt-On(X,Y:End :Line(X-4,B+P,X+4,B+P,0:End:Y→C :While pxl-Test(63-Y,X)=0 :getKey→K :Line(X-4,C,X+4,C,0:Pt-Off(X,Y :Y-1→Y :X-(K=24 and X≥3 and pxl-Test(62-Y,X-1)=0)+(K=26 and X≤91 and pxl-Test(62-Y,X+1)=0)→X:Pt-On(X,Y :Z-(randInt(1,15)=1 and Z>12)→Z :Line(Z,57,Z,59,0 :End:Y→B :Z-(randInt(1,15)=1 and Z>12)→Z :Line(Z,57,Z,59,0 :If X≥90 and Y≥53:1→θ :If Z≤13:2→θ :End :If θ=1:Then :Text(26,22,"You beat Level 1! :rand(150 :For(F,0,94,2 :Line(F,0,F,62 :Line(F-1,0,F-1,62 :Line(F,0,F,62,0 :Line(F-1,0,F-1,62,0 :End :Else :If θ=2:Then :Text(-1,25,20,"Game Over :Text(32,35,"No Air! :End:Stop