0

Basically, the way it works is that it update the frame to show every let's say 24 ticks and every time the frame update, it recalculates the height and width of the new sprite to render so that my gravity logics and stuff works well. But the problem i am having now is a bit hard to explain in words only, therefore i will use this picture to assist me

The picture

So what i need basically is that if let's say i froze the sprite at the first frame, then unfreeze it and freeze it at the second frame, have the second frame's sprite (let's say it's a prone move) simply stand on the foothold without starting the gravity and when switching back, have the first sprite go back on the foothold like normal without being under the foothold.

I had 2 ideas on doing this but I'm not sure it's the most efficient ways to do it so i wanna hear your inputs.

Lukas Knuth
  • 25,449
  • 15
  • 83
  • 111
Nicolas Martel
  • 1,641
  • 3
  • 19
  • 34
  • I'm voting for "Off Topic", because this might be better suited for [gamedev.stackexchange.com](http://gamedev.stackexchange.com) – Lukas Knuth Sep 07 '12 at 23:08

1 Answers1

0

Fixed my problem, not sure if it will still function effectively in the future but it seems like a pretty good way to me

(i added a currentFoothold defenition the entity with for the object Foothold and when the entity isOnGround, set that foothold object to the foothold he currently is standing on, naturally. When recalculating height, if the entity isOnGround && foothold != null set the entity's Y coordinate to the foothold's Y coordinate in the map)

Nicolas Martel
  • 1,641
  • 3
  • 19
  • 34