sc2c.org

Go Back   Sc2C.org > Developer's Corner > Scripting
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 09-20-2010, 04:09 PM   #1
BloodMoon
Junior Member
 
Join Date: Sep 2010
Posts: 5
Default Acceleration Movement

Hello, i could use some help with a movement system, i need a way to make the players unit decelerate and then accelerate.

So far i have the basic idea of using left and right arrow keys to turn the unit, and up accelerates the unit in the facing direction (not exactly sure how to code that part). But the real problem I'm having is finding a way to have the unit say moving at 90 degrees, rotate to 270 degrees (still moving on the 90 but facing 270) then accelerate in the 270 direction. I need to have the unit to slow down till a speed of 0 is reached then pick speed up again.

The variables i've decided to use so far are:

speed (calculated by calculating acceleration and dividing by a constant to represent a game unit)

travelDirection (this is no longer calculated when the player releases the UP key, allowing the unit to then turn without causing the unit to move in a new direction (if using facing direction for movement))
BloodMoon is offline   Reply With Quote
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT. The time now is 06:18 PM.


Powered by vBulletin
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.