Scrolling Game Development Kit Forum

SGDK Version 1 => Help/FAQ => Topic started by: Retro on 2007-10-06, 10:14:36 AM

Title: Sprite Issues with Movement and Jumping
Post by: Retro on 2007-10-06, 10:14:36 AM
My first issue has to do with my sprite running constantly - even when he is standing still.  I have checked the box to reset the sprite to initial stance when he isn't moving, but that frame of him standing still is still in the running animation.

My second issue has to do with him jumping.  When you press up to jump and hold it down, he flys.
Title: Re: Sprite Issues with Movement and Jumping
Post by: durnurd on 2007-10-06, 06:09:04 PM
Under frames tab: check "Correlate animation speed with velocity" to solve the animation problem

Under motion tab: check "Up requires solid" to solve the flying problem
Title: Re: Sprite Issues with Movement and Jumping
Post by: Retro on 2007-10-08, 04:42:23 PM
I appreciate the help, but I don't think I worded my first question properly.  When my "player" runs..  the pose that he should be at while stationary is repeated in the sequence, so it looks like he is running properly but when it loops it displays the frame of him standing as well.  Paired to that, when the motion stops, it does not go back to the frame of him standing still - the sprite stops at whatever frame he is currently in.

You did fix the jumping issue, thank you.
Title: Re: Sprite Issues with Movement and Jumping
Post by: bluemonkmn on 2007-10-08, 05:07:49 PM
There is no feature in GameDev 1.x to assist in excluding the standing image from the running animation.  The purpose of the "reset" checkbox is to allow you to reset the image to the frame that most closely resembles standing (by making it the first frame and checking the box) rather than just stopping on any arbitrary frame that was active when the player stopped moving.  But it's not smart enough to exclude the standing frame from the running animation.  I'd suggest eliminating the standing frame, and just make sure that the first frame of your running animation is one that looks OK when the sprite is standing still.

Also, if the sprite is not resetting to the first frame when the sprite stops moving, double-check that the checkbox is actually checked (it sounds like you saw no change between this and the box being un-checked).  It's easy to forget to press Update after making a change.
Title: Re: Sprite Issues with Movement and Jumping
Post by: durnurd on 2007-10-08, 08:21:31 PM
You can also have different states for accelerating and not accelerating.  That may be what you're looking for.
See the Forest graphics sample (http://sourceforge.net/project/showfiles.php?group_id=70424&package_id=111605&release_id=251098) to see how this works with the Player sprite (2nd in the list)