Re: Player related stuff, need help.

Well ok, let's try to get you to code it then, because I don't know how you want it to work.

So, first let's examine the jump. What takes place when you jump? 
When you jump, you begin ascending. While ascending, you gradually rise upward. At the peak of your jump, you hang in the air, and then begin descending at the same speed.
Now how would you code this?

Well, after you press up arrow, you, obviously, need to play jump, set jumping to true so that it knows your in the air, and set ascending to true because that's what you do next.

Then, you need to make an if statement, saying if(jumping==true), witch will be true the entire time you are in the air.
Inside this if statement is more if statements. First, you need to make the player gradually rise, so everytime the risetimer or jumptimer is elapsed>=jumptime. rise by 1, update listener position. Once you are above your maximum jump height, you want to descend.
Skip this part if you don't want your player to hang in the air for a moment when at the peak of there jump.
So, if you want them to hang, you would have to say, still in the jumping==true statement, if(Atapex==true and apextimer.elapsed>=apextime) then you would start descending. So obviously, in your if statement to check if your above the jump height, you would set apex=true;.

Descending is just the same as ascending, except with ascending==false instead of true.

Once you are back at 0, or where you jumped from, just play land.ogg, and set jumping to false and you should be good.

I hope this helped a bit.
-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
  • ... AudioGames . net Forum — Developers room : Ahng via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Ahng via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Ahng via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : audiogame via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Ahng via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : redfox via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Ahng via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : redfox via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Ahng via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : redfox via Audiogames-reflector

Reply via email to