How to do this Enemy-Bullet configuration? [SOLVED]

This forum is currently in read-only mode.
From the Asset Store
This pack contains 10 types of bullet effects, with different shapes and colors.
  • .CAP file in question

    What I would like to happen:

    An enemy I have in a spaceship horizontal-scrolling game has the set movement pattern of up-and-down.

    While it is traveling down, I have set its private variable "BulletTime" to 1.

    IF BulletTime is 1, and IF the Enemy's Y is equal to the Player's Y, it should spawn a bullet "Ray"

    If the player's X is less than Enemy, "Ray" moves at angle 180.

    If the player's X is greater, "Ray" moves at angle 0.

    However, this should only happen once per cycle; I don't want to have a sheet of bullets following my player (this is what happens when I set the parameters to anything BUT Player.Y = Enemy.Y).

    What DOES happen:

    The enemy moves down, and then fires the "Ray", but only does so once in its entire movement cycle. Naturally to avoid getting hit, the player will have to move out of the way, but once the player moves out of its initial position, the enemy will not fire again.

    What my events look like:

    NOTE -If you wish to look at a .CAP, just ask, if this isn't helping-

    NOTE2 -the private variable 'Border' determines which direction the enemy moves in

    <img src="http://i417.photobucket.com/albums/pp257/Emperor_Phoenix/Construct%20Problems/SSATroubleShoot1.jpg">

  • yeah post cap, can't tell from that

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Updated. The area in question is Layout "L3", with the event sheet "Enemies"

  • <img src="http://dl.dropbox.com/u/1013446/ships.png">

  • Tested it out and that worked like a charm!

    I am pretty limited in my knowledge of certain C.0X functions, so the thought to use absolute values in System CompareValues never crossed my mind.

    Thanks a whole bunch!

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