Construct failing to treat objects as individual entities

For questions about using Classic.

Post » Wed Dec 17, 2008 10:44 pm

I wasn't sure if this was a bug or if this is being caused by something that I'm doing wrong. I was pretty close to submitting this to the bug tracker but then I reconsidered since this may not be a bug (or maybe it is, I don't know).

Anyway, take a look at this:
http://machriderx.googlepages.com/shooter.cap

Open the .cap and run the layout. Notice that when you shoot an enemy, it destroys all the enemies at once.

Now go to the event editor, remove the "enemy is on screen" condition (only the "enemy on screen" one, leave the collision condition alone) and run it again. Now the enemies are destroyed by your bullets one at a time, how it should be.

I'm puzzled though. Why does adding the event "enemy is on screen" make it so that it destroys all enemies? Is this a bug?

If it isn't, how do I make it check for whether each individual enemy is on screen? I thought it was automatically supposed to do that.
B
2
S
2
G
4
Posts: 153
Reputation: 1,756

Post » Wed Dec 17, 2008 10:47 pm

You need to move the "Is on screen" condition below the collision condition, otherwise it picks all of the enemies on the screen. This is because conditions are read from the top down.
Moderator
B
98
S
36
G
19
Posts: 1,584
Reputation: 17,717

Post » Thu Dec 18, 2008 1:29 am

Thanks. I knew I was doing something wrong. I didn't know the order mattered. I'll keep that in mind from now on.
B
2
S
2
G
4
Posts: 153
Reputation: 1,756


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 3 guests