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))
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.
|All times are GMT. The time now is 11:04 AM.|
Powered by vBulletin
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.