Problems with enemy bullets

0 favourites
  • 6 posts
From the Asset Store
Give Sound to the enemies that are part of your game! :)
  • I keep having problems with my walking and shooting enemies.

    I have set them when they see the player they fire with an instance variable that sets the direction of the bullet. Unfortunately the other enemies that don't see the player keep moving and when they change direction it sets the direction of the bullets to the other way.

    It's probably simple fix but it's driving me mad.

    Cheers

  • I think I understand what you mean... Give the bullets their own instance direction variable, update it with the direction when fired and they will act autonomous.

    Unless you mean it sets the enemy instances firing direction the other way... in which case you would need to condition out enemies in LOS of of player by adding a condition to the direction change event that only allows non-sighting enemies to advance to actions.

  • I think that second method may work. Basically when it see's the player it with fire straight at him but if another enemy is still walking and hits the change direction sprite it will change the direction of the bullet.

    I didn't get why it did it because the bullets and enemies all had instance variables to set directions.

  • Its doing it because they are all clones (instances) of the original and you need to separate out the instances you want to be affected by an event otherwise Construct2 simply tells them all to act. Read Ashley's advanced events tutorial and focus on "Picking": https://www.scirra.com/tutorials/292/guide-to-construct-2s-advanced-event-features. It will help get your head around it some.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks now I'm trying to make each each sprite shot in its own independent direction depending on the UID.

    I really didn't think I would find it so damn hard.

  • Solved it now and it was so simple thanks for the help

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