Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Sprite movement with setspriteX and impulse issue

Author
Message
gsdblack
12
Years of Service
User Offline
Joined: 6th Dec 2011
Location:
Posted: 2nd Feb 2013 03:14
I'm working on a game that is a constant side scroller. I move the the viewpoint and sprite like this



Jump



I want to use the impulse function because it makes the character jump look smooth and not choppy. The problem is when I try to use impulse function the setspriteX interferes with it.



Has anyone run into this issue? Other thoughts on moving the character with the screen and using impulse?
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 2nd Feb 2013 08:58
You cannot add impulse if you are constantly setting the position manually. You need to either set the player velocity in x and add impulse in y , then set the view offset based on the sprite position OR set everything manually and don't use physics.

Setting the sprite position always messes with dynamic physics sprites I'm afraid. Hope that helps!


this.mess = abs(sin(times#))
gsdblack
12
Years of Service
User Offline
Joined: 6th Dec 2011
Location:
Posted: 2nd Feb 2013 17:04
Thanks bax. That partly helps. Sometimes the player will run into objects that will make her stop but I want the screen to keep movin (think mario get gettin pinched by the screen). So is there a way to convert change in x to velocity? Ill on the code later

Login to post a reply

Server time is: 2024-05-06 17:22:19
Your offset time is: 2024-05-06 17:22:19