Help with directional velocity acceleration.

You must understand the Game Editor concepts, before post here.

Re: Help with directional velocity acceleration.

Postby skydereign » Sun Mar 13, 2011 12:39 am

Try this. I had the ship decelerate when you want to go backwards. When it reaches a certain speed, it sets a variable telling the ship that it is moving backwards and begins to accelerate (but moving backwards). The variable backwardsState also tells the animation that it should rotate the animation 180 degrees when you are moving backwards. The only other thing is that the mouse button down events for the buttons also have a bit of code. It essentially says if the ship was moving backwards, flip it back. Do note that if you start moving forward again, you will continue moving at the same speed you were moving backward, as I didn't implement the slow down, speed up in the other cases. Lastly, in player's draw I put a switch statement instead of a lot of those ifs.
Attachments
UA.ged
(12.92 KiB) Downloaded 26 times
User avatar
skydereign
 
Posts: 3395
Joined: Mon Jul 28, 2008 8:29 am
Score: 565 Give a positive score

Re: Help with directional velocity acceleration.

Postby FERdeBOER » Sun Mar 13, 2011 10:18 am

Thank you very much!

It works exactly as I intended to! Is very kind for your part, I don't know how to thank you for this. :oops:

Thanks, thanks.
FERdeBOER
 
Posts: 36
Joined: Fri Mar 12, 2010 8:03 pm
Location: Good question...
Score: 0 Give a positive score

Previous

Return to Advanced Topics

Who is online

Users browsing this forum: No registered users and 1 guest