Speed up Actor over Time
Tried to find the answer in the forums - Just trying to speed up an actor over time.
So I've got a game.speed (interger) attribute and I want it to speed up by +5 every 15 seconds or so.
on the actor I've got change attribute game.speed to game.speed+5
but how do I define speed? I tried a Rule if game.speed +5 then accelerate....
So I've got a game.speed (interger) attribute and I want it to speed up by +5 every 15 seconds or so.
on the actor I've got change attribute game.speed to game.speed+5
but how do I define speed? I tried a Rule if game.speed +5 then accelerate....
Comments
I'd do something like this:
- create a self.previousXvel (integer attribute)
This will give you a smooth increase in the speed (looking like a temporary acceleration).
Obviously the timing you can alter and the first 'change attribute' is `change to self.motion.X'
Yeah I was trying to get it to accelerate in any direction, so I tried your example but seemed to go pretty nuts on the x and y and doesn't speed up over time lol. Here's what I have:
every 1 second
change self.speedup to self.motion.linear velocity.X
change self.speedup to self.motion.linear velocity.Y
interpolate self.motion.linear.X to self.speedup+25
interpolate self.motion.linear.Y to self.speedup+25
However, if for some reason you want to "roll your own" acceleration behavior:
http://en.wikipedia.org/wiki/Equations_of_motion