Increasing speed of the enemies every x seconds

Get help using Construct 2

Post » Sun Feb 16, 2014 10:53 pm

Hey,

I'm creating this very simple "avoid the falling enemies or die" game.

Currently I am stuck with creating an algorithm that will make the enemies fall progressively faster, thus making it harder for the player to avoid them. The idea is to start slow and make the game harder every 10 seconds. I am very new to construct so my noob friendly experiment with creating a system event that says every 5secs / set speed to 500 did not work. I tried with subevents, creating new objects, but no luck. I am sure this is fairly easy to achieve but regardless, any help would be nice.

Cheers! :)
B
9
S
1
Posts: 51
Reputation: 639

Post » Sun Feb 16, 2014 10:59 pm

You have to use a (global) variable. You can call it enemyspeed for example.

Then you have to use "add to" instead of "set value". Because you dont want to set the speed always to 500. You want to increase it by 500.

It should look like:

Every X seconds - add to- enemyspeed - 500

You can also set a timer at the beginning of the layout, repeating every 5 or 10 seconds. Then instead of "Every X seconds" you can use the Timer condition.Alyra Games2014-02-16 23:01:52
B
10
S
2
Posts: 135
Reputation: 1,090

Post » Sun Feb 16, 2014 11:01 pm

Hm, how would I incorporate this into a bullet behaviour mechanic?
B
9
S
1
Posts: 51
Reputation: 639

Post » Sun Feb 16, 2014 11:03 pm

Instead of "add to" you choose the object, than search for "set speed" under the bullet tab. Than you write bullet.speed+500 where bullet is your object name.

If you want the bullets to become faster.Alyra Games2014-02-16 23:06:18
B
10
S
2
Posts: 135
Reputation: 1,090

Post » Mon Feb 17, 2014 1:23 am

I think I got it.

I do believe I need some tweaking though, it occurs while there are already other "enemies" on the board, therefore, the player feels a bit of inconsistency.

Any thoughts on that. I thought about adding a full screen Particle effect that would stop the animation and once finished start it all over again + 10 speed of course.
B
9
S
1
Posts: 51
Reputation: 639

Post » Mon Feb 17, 2014 1:31 am

don't forget about delta time

You can do: Sprite | set bullet speed to: sprite.bullet.speed+10*dt
this way sprite will accelerate by 10 every second.
ImageImageImageImage
B
157
S
64
G
41
Posts: 2,590
Reputation: 34,640

Post » Mon Feb 17, 2014 1:40 am

I made it work :)

What I did was I created a global setting called globalspeed. Then, I set the game to create an object every x seconds. Objects had bullet behaviour. Therefore, their set speed was globalspeed (which was previously set to 300). After that, I put in another system variable where I ordered the game to count to 30 seconds and then kill all the enemies, create particle effect and immediately increase the speed to + 30.

Works like a charm
B
9
S
1
Posts: 51
Reputation: 639


Return to How do I....?

Who is online

Users browsing this forum: Yahoo [Bot] and 4 guests