I have enemies that have an "attack timer" value, that is only being added to while they are on the screen. When their attack timer reaches a certain value, they create a bullet. This bullet is an object that can bounce around the screen. When the bullet is created, its xSpeed, ySpeed, and life span are set (All alterable values, of course.)
It works just fine, as long as only one of the enemies on screen is firing. If two enemies fire at the same time, only one of the bullets will recieve the proper values. The other is left just bouncing in place since it doesnt have a proper xSpeed value or anything.
Alright well I can type out the lines that are in question:
Attack Timer of (Shooting Enemy) = 200
X position of (Player) > X("Shooting Enemy")
(Shooting Enemy): Change animation sequence to Shoot
(Create): Create (Bullet) at (0,0) from (Shooting Enemy)
(Bullet): Set xSpeed to 1
(Bullet): Set ySpeed to (4+Random(3))*-1
(Bullet): Set Lifespan to 150
(Sound): Play sample zap
Attack Timer of (Shooting Enemy) = 200
X position of (Player) <= X("Shooting Enemy")
(Shooting Enemy): Change animation sequence to Shoot
(Create): Create (Bullet) at (0,0) from (Shooting Enemy)
(Bullet): Set xSpeed to -1
(Bullet): Set ySpeed to (4+Random(3))*-1
(Bullet): Set Lifespan to 150
(Sound): Play sample zap
Okay, so if there are two enemies on the screen that reach 200 in their attack timers at the same exact time, there will be two bullets created. However, only one of those bullets will get the events:
(Bullet): Set xSpeed to -1
(Bullet): Set ySpeed to (4+Random(3))*-1
(Bullet): Set Lifespan to 150
H'm, I don't know if this'd be a defining factor, but when comparing the position of an enemy and a player, you should always do it relative to the enemy.
That is, instead of this:
X("Player") > X("Shooting Enemy")
Do this:
X("Shooting Enemy") <= X("Player")
That way it'll test through all of enemies, instead of just once through the player.