Re: The perfect fall/jump
Posted: Sun Jun 09, 2019 11:42 am
I'd say most Spectrum games don't use proper laws of physics. To be specific they don't use things described
here https://en.wikipedia.org/wiki/Acceleration
Modern games may be different as they ofen use sophisticated physics engines. It's possible as modern computers
have a lot of CPU power which games from the 80s lacked.
In Spectrum games the speed of falling is generally constant, not v(t)=v0+at like in real world. Check Manic Miner as example.
And actually nobody complains about it. It's a part of gaming convention, just like things that killed enemies
dissappear or hero keeps gun in right hand when walking right but in left hand when walking left
----------------------------
In my games like Janosik or Wunderwaffe (they use the same adjusted engine) I used the following logic:
- player has a status like standing on a ground, jumping or falling
- jump has defined number of steps, each step=one frame of the game
-first you go quickly up by 2 pixels, then slowly up by 1 pixel, then for a moment don't change your height,
then slowly down by 1 pixel, then quickly down by 2 pixels
- when you are going down during jump at any time it can be interrupted if your feet hit some floor
- when jump ends and you are still in the air, player changes status from jumping to falling
- during falling you fall with constant speed of 2 pixels until you hit the ground
So yes. I didn't use accelaration when falling. I believe it would make everything harder to code
and there wouldn't be any noticable improvement in the gameplay.
here https://en.wikipedia.org/wiki/Acceleration
Modern games may be different as they ofen use sophisticated physics engines. It's possible as modern computers
have a lot of CPU power which games from the 80s lacked.
In Spectrum games the speed of falling is generally constant, not v(t)=v0+at like in real world. Check Manic Miner as example.
And actually nobody complains about it. It's a part of gaming convention, just like things that killed enemies
dissappear or hero keeps gun in right hand when walking right but in left hand when walking left
----------------------------
In my games like Janosik or Wunderwaffe (they use the same adjusted engine) I used the following logic:
- player has a status like standing on a ground, jumping or falling
- jump has defined number of steps, each step=one frame of the game
-first you go quickly up by 2 pixels, then slowly up by 1 pixel, then for a moment don't change your height,
then slowly down by 1 pixel, then quickly down by 2 pixels
- when you are going down during jump at any time it can be interrupted if your feet hit some floor
- when jump ends and you are still in the air, player changes status from jumping to falling
- during falling you fall with constant speed of 2 pixels until you hit the ground
So yes. I didn't use accelaration when falling. I believe it would make everything harder to code
and there wouldn't be any noticable improvement in the gameplay.