0 Members and 5 Guests are viewing this topic.
:If V>0:For(I,1,V):If pxl-Test(X,Y+I+7)+pxl-Test(X+7,Y+I+7):Y+I→Y:0→V:Else:Y+V→Y:End:End:End
.HOGGY[007E425A5A427E00]→Pic11→L→F→G→V+4→Y*5→XClrDrawLine(1,60,90,60)Pt-Off(X,Y,Pic1).Main loopWhile 1 Text(1,1,G►Dec) Pt-Change(X,Y,Pic1) If getKey(15) ClrDraw Return End .Control movement getKey(3)-getKey(2)+X→X .Gravity Acceleration (this doesn't need to be in a subroutine) If G=1 V+1→V End .Collision test Sub(PLT) Pt-On(X,Y,Pic1) DispGraph End.Subroutines begin hereLbl PLT If V For(I,1,V) If pxl-Test(X+1,Y+I+5) or pxl-Test(X+6,Y+I+5) Y+I-2→Y 0→V 0→G Return .If something is hit, the program returns to the main loop End End .If I went through the For loop without hitting anything... If F .(I'm assuming that F can only be 1 or 0 here) Y+V→Y Else Y-V→Y End EndReturn
This might not be what you wanted in your game, but doesn't gravity increase velocity quadratically?