How do I apply speed changes to a family of enemies?

Get help using Construct 2

Post » Mon Jun 09, 2014 2:53 pm

Hey guys, my game spawns enemies at random from the edges of the screen and directs them towards the player character, when the enemies leave the screen they are destroyed and new enemies are created at random from a family of enemies. I'm trying to slow the family of enemies with varying speeds by a percentage when I call a function.

Here's how i'm spawning enemies:
Image

Enemy family settings:
Image

Function call to apply the speed change to their instance variable speed:
Image

This is not currently working, I'm having some difficulty figuring this out. Any help is greatly appreciated.
B
6
S
1
Posts: 13
Reputation: 426

Post » Tue Jun 10, 2014 11:44 pm

In your events you set the Bullet.Speed set to self.speed or enemies.speed.
Then you set enemies.speed to Bullet.Speed which is retrieve value from enemies.speed.
So how the enemies.speed gets value from?

We determine the Speed of Bullet from enemies.speed, so we just need focus to manipulate it's own value something like:
Subtract 10 from speed
ImageImage
B
102
S
46
G
22
Posts: 772
Reputation: 21,593

Post » Wed Jun 11, 2014 12:07 am

When an enemy is created I set their bullet speed to the speed in their instance variable speed.
When I want to change their speed I call the function "slowBlocks", this sets their instance variable speed to their current bullet speed minus a percentage 50% in my screenshot example.

No speed changes are applied.
B
6
S
1
Posts: 13
Reputation: 426


Return to How do I....?

Who is online

Users browsing this forum: adamebastin, Bro7hers, ketramtu18 and 10 guests