Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 14 May 2013
Offline Last Active Nov 18 2014 01:15 PM

Topics I've Started

Stange animation artifact

22 May 2013 - 03:16 PM

All I wasn't sure which forum to place this in as it's quite an odd question. My 2d platformer has an odd problem but I'm not sure it's a real problem as such. I'll try to explain as best I can. When my character jumps into the side of a platform, and then on top of it, it looks, momentarily like there is a 'glitch' in the animation. Thing is, if I put a thread.sleep in to slow the game down, I can't see any such glitch. If I video it and plat it back, again I can't seem to see anything. Has anyone come across something like this before? Could it be an issue bought about by my frame rate? Sorry it's so vague but I'm not sure how else to explain it. It's not a deal-breaker but it is extrememly annoying. Any thoughts would be welcome. Thanks.

2d Platformer Gravity - constant or conditional!?

14 May 2013 - 08:17 AM

Hi Guys


I'm currently writing a 2d platformer for Android smartphones / tablets and I have a question regarding gravity.


I read up a bit before I applied gravity and from what I could tell, it seemed that gravity should be applied 'constantly' to characters (Like it is in real life).


By this, I mean, if the character is standing on a solid floor/platform, gravity will still be pulling him down.


My collision detection, will predict that his next position will be 'in' the platform and correct it before rendering.  This way, when he isn't on a platform, he will just fall without me having to do anything extra.


However, I read an interesting article about how Sonic was made and it states that:



(Of gravity) This value is added to Y speed in every step in which Sonic isn't on the ground.


So I'm guessing they have a boolean value 'gravity' and just switch it true or false depending on when they want the gravity to be applied. (So false when on floor/platform, then switch to true when not).


I'm just wondering which of the two methods do you advocate and why?  Which one would be easier to work with and why?