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

Thread Tools Search this Thread Display Modes
Old 09-20-2010, 04:09 PM   #1
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
Old 09-21-2010, 05:51 AM   #2
Data Editor ZOMG
Adovid's Avatar
Join Date: Aug 2010
Posts: 41

You can use a behavior buff to modify move speed and acceleration. Make it have a short duration and apply it with a trigger or a persistant effect periodically.

You could set the buff up so you can stack it(to move faster) or modify them with catalogs (change the attribute of the buff so the same buff makes units move faster or slower).

You aren't just limited to move speed, you can modify the unit's time rate so it moves, turns, animates, morphs faster or slower too.

Last edited by Adovid : 09-21-2010 at 05:54 AM.
Adovid 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 08:38 PM.

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