The perfect fall/jump

The place for codemasters or beginners to talk about programming any language for the Spectrum.
Posts: 108
Joined: Sun Nov 12, 2017 3:54 pm

Re: The perfect fall/jump

Post by redballoon » Sun Jun 09, 2019 8:53 pm

R-Tape wrote:
Sun Jun 09, 2019 7:36 pm
Nice. I guess the exaggeration and base over apex jumps demonstrate that one should forget theory and go with whatever looks good!
Bingo! And I recommend this book, which is what I use. I've got it sitting out next to me for reference when I need it while doing Melkhior's Mansion animation.


Course, you may only have 4 frames...or 2 or 8, but if you're going to be doing any motion graphics, then, really, it certainly doesn't hurt knowing this. There is a PDF of the above book available if you do a Google search for it.
0 x

User avatar
Manic Miner
Posts: 494
Joined: Mon Nov 13, 2017 8:50 am
Location: Bristol, UK

Re: The perfect fall/jump

Post by Morkin » Mon Jun 10, 2019 8:37 pm

R-Tape wrote:
Sun Jun 09, 2019 8:25 pm
And the less said about cyan the better :shock:

That's going to give me nightmares.
1 x

Manic Miner
Posts: 357
Joined: Thu Nov 16, 2017 10:54 am

Re: The perfect fall/jump

Post by hikoki » Thu Jun 13, 2019 7:34 am

mcleod_ideafix wrote: After refreshing my physics here: ... tucion.htm

I've came up with this:

Which shows this:

In the listing:

Code: Select all

hmax : initial height of the particle. Set to 175 (maximum height in pixels)
vxo : X component of velocity vector. The more you put here, the farther
the particle will get to the right.
vyo : Y component of velocity vector. Initially set to 0.
e : coefficient of restitution after a colission with the ground.
g : 9.8 m/s^2
x,y : particle position in each time slice.
t : time. It's reset to 0 after each colission, as the colission marks
the beginning of a new parabolic trajectory.
Post at WoS: ... ent_639936
1 x

User avatar
Manic Miner
Posts: 431
Joined: Wed Dec 06, 2017 2:13 am
Location: New Zealand

Re: The perfect fall/jump

Post by djnzx48 » Thu Jun 13, 2019 8:00 am

That listing looks a bit overly complicated to me. How about this:

Code: Select all

 1 LET g=-0.025: REM gravity
 2 LET b=-0.8: REM bounce factor
 5 LET vx=0.5: LET vy=0: REM velocity
10 LET x=0: LET y=175: REM displacement
20 PLOT x,y
30 LET vy=vy+g
40 LET x=x+vx: LET y=y+vy
50 IF y<0 THEN LET y=0: LET vy=vy*b
60 IF x<=255 THEN GO TO 20
0 x

Post Reply