A question concerning attacking enemies.

0 favourites
  • 8 posts
From the Asset Store
Moles Attack game assets for 2D whack a mole smash and hit action fun game.
  • Greeting Construct 2 users,

    How can I make an enemy shoot projectiles at the same time that the enemy is moving from right to left? This is a picture of the code that I have placed in the Event sheet to make the enemy move from right to left, so what kind of code can I add to make the enemy shoot laser rays and missiles while moving right to left?:

    Tagged:

  • If direction is 1, every X seconds spawn a bullet set angle to 0

    If direction is -1, every X seconds spawn a bullet set angle to 180

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • To plinkie:

    I followed your instruction and the result was that the spaceship remains at the top left of the screen and doesn't move. I want it to move from the left to the right while the spaceship is shooting and it seems that your code doesn't work or I did not put it at the right place. This picture represents what I did with the code that you sent me, not that those codes are placed in three different blocks of codes and they are hot merged:

    Block 1:

    Block2:

    Block3:

  • Just a question: why don't you use the sine behavior to move?

    Check this example.

    Your code seems unecessarily complicated for me.

  • Ah ok I imagined your game wrong, to spawn the stuff you just use every X seconds and not use the directional conditions. I realise it's firing the stuff down the screen now. You spawn the objects and set angle of motion to 90 that's about it.

  • To brunopalermo:

    I can't see your example because your Construct 2 version is more advanced. This is the error message that appeared on my screen when I tried to open the Construct to file that you sent me:

  • To brunopalermo:

    I can't see your example because your Construct 2 version is more advanced. This is the error message that appeared on my screen when I tried to open the Construct to file that you sent me:

    Thanks very much!

  • Update.

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