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

0 favourites
  • 3 posts
From the Asset Store
A collection of various zombie characters sprites for creating a 2D platformer or sidescroller game
  • 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

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)