Soooo, this is the first physics engine I've ever built, and I'd appreciate whatever constructive criticism you all have to offer. :3
Without further ado:
Program:TEST ... //some basic initialization stuff; the window is x from -47 to 47 and y from -31 to 31 0→R:45→C //Row, Column coordinates 0→V //Velocity .1→A //Acceleration Horizontal -10 //easy flat "ground" Lbl A Repeat Ans If pxl-test(iPart(R)+6,C):Then 0→A //Turn off gravity when you hit the ground V(V≤0)→V //Avoid getting "stuck" to the ground Else .1→A //No more Wile E. End Text(iPart(R)),C,"_") //erase your old "sprite" V //Call V for Ans (Ans+A)(Ans<2)+2(Ans≥2)→V //Don't let V go over 2 pxl/frame (for pxl-Test reasons) R+Ans→R Text(ipart(Ans),C,"X") //Draw your new "sprite" getkey→θ End C+(Ans=26)-(Ans=24)→C //Left and Right move V-2(θ=25)(V=0)→V //Up jumps A+.1(θ=25)→A //Turn A back on... Goto A
The basic idea came from the ideas that $\Delta x=v\Delta t$ and that $\Delta v=a\Delta t$. I set $\Delta t$ to "1 frame," and just substituted $\Delta x = x-x_i$ and $\Delta v = v-v_i$ for the final results of $x_i+v=x$ and $v_i+a=v$. I just evaluate these every frame to find the new position (shown as C in my program). Note that up is considered the negative direction.
A little more formal than what I actually did in my head, but that's the principle.
EDIT: I forgot to mention, my method of drawing a sprite leaves a "trail" for some reason… My guess is that the _ (space) is slightly smaller than the "X" maybe. I'm still not that familiar with the graph screen.
EDIT$_2$: Lol, if you walk off a platform, you Wile E. Coyote and don't fall (I fixed it in the code).