Jump to content
A 2021 backup has been restored. Forums are closed and work in progress. Join our Discord server for more updates! ×
SoaH City Message Board

knuckles gliding


knucis

Recommended Posts

Well, I'll try to explain it here...

Okay, the first thing you need to do is check to see if Knuckle is either jumping or falling. Depending on your engine, that could either be determined by a flag (IE : If Flag 10 is on, display Knuckle's jumping animation) or by his Y velocity/speed (IE : If Knuckle's Y velocity is different than 0, display Knuckle's jumping animation).

Now, you'll wanna see if the player has already let go of the jump button (after he jumped), and is pressing it for the second time to start the glide. The concept behind that is explained in this topic...

http://www.sonicfangameshq.com/forum/showthread.php?t=1113

Okay, once you've determined that this is the second time the jump button has been pressed, either set a counter to a value, or set a flag on.

Now, go back to your gravity code. You'll need to create two types of gravity. IE...

~If Glide Flag is OFF, AND Y speed is greater than 0

~Every .13 seconds

*Subtract 5 from Sonic Y speed

{This is regular gravity}

~If Glide Flag is ON, AND Y speed is greater than 0

~Every .13 seconds

*Subtract 1 from Sonic Y speed

{This is gliding gravity, which is much lighter}

Finally, if you let go of the jump button, then the flag is set back off, and you fall.

----------------------------

I hope that helps.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...