Hi!
I have an enemy I want to increase the speed with 5 every 30 sec. What is the best way to do that?
Hi!
I have an enemy I want to increase the speed with 5 every 30 sec. What is the best way to do that?
Use the timer object and do every 30 seconds then for the action, go to set speed for the object. Then type: Speed( "enemy" ) + 5
If you're creating and destroying enemies, you might want a slightly more robust approach:
+Always
=Set Speed of "Enemy" to 50 + seconds / 6
or
50 + int(seconds / 30) * 5
Thanks to both of you. I will try it later.![]()
alspal's example works great, but when I destroy the enemy and it creates a new one, the speed is starting at the beginning.
I tried Pixelthief's example too, but I can't get it working.
Can you please give me a little more detailed?![]()
whoops I made an error on that
hah, I always mix that up
I forgot, "seconds" returns only the seconds part of the timer, which keeps resetting from 0 to 59. Theres no built in function to return the # of seconds since the game started.
Change it to say
+Always
=Set Speed to 50 + int(Timer / 30000) * 5
Timer gives it in 1/1000 seconds (milliseconds) since the start of the frame. So 30000 millseconds = 30 seconds. The "Int()" function will round this down, so it will always jump up from 0 to 1 to 2 to 3, where if you didn't use int() it would take fractions like 1.24 and 3.45 seconds, and the speed would be moving up constantly instead of +5 every 30 seconds
Originally Posted by Pixelthief
I must do something wrong, Because it doesn't seem to work. The enemy is moving the speed of 50. I change 50 with 12 and the enemy is moving slower, but the speed doesn't change with 5 every 30 sec.
Heres an example file:
(using 10 base speed and +10 speed every 5 seconds)
http://sites.google.com/site/claniraq/stuff/movementexample.mfa?attredirects=0&d=1
Thank you.![]()
I have another question. After I have killed the last enemy, I want to create one more enemy. Example:
In start of frame, I have 1 enemy. I kill it and 2 more enemies is appearing. I kill these two. 3 more enemies is appearing, etc, etc.
I have tried with loops, but without luck. Can anyone help me?
Thanks![]()