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:
Enemy family settings:
Function call to apply the speed change to their instance variable speed:
This is not currently working, I'm having some difficulty figuring this out. Any help is greatly appreciated.
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
Develop games in your browser. Powerful, performant & highly capable.
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.