This site requires JavaScript, please enable it in your browser!
Greenfoot back
ALPH3A
ALPH3A wrote ...

2017/4/3

increasing speed

ALPH3A ALPH3A

2017/4/3

#
Hello, I am wanting to make my actor speed increase by 1 every 30 frames, how would i do this. thanks
danpost danpost

2017/4/3

#
ALPH3A wrote...
Hello, I am wanting to make my actor speed increase by 1 every 30 frames, how would i do this. thanks
Thirty frames would only be about 1/2 of a second (in a scenario running at normal speeds). It will not take very long for the actor to be going at hyper speeds. To illustrate, after 10 seconds, the actor will be able to traverse a 600-pixel wide world in less than 1/2 of a second. However, if that is what you want, add an int field to count act frames an increment it in the act method. Every time it reaches 30, set it back to zero and increment the speed of the actor.
ALPH3A ALPH3A

2017/4/3

#
yeah. maybe every 300 frames
You need to login to post a reply.