Instance variable bug r51.2

Bugs will be moved here once resolved.

Post » Thu Aug 25, 2011 2:49 pm

I have created simple project for that. Plane has set health (instance variable) to 3, and there is a group, which goes active when it is hit. However when plane health is below/equal 0, each plane is destroyed not just this particular one, i'm shooting at (another thing is that I need to hit it 4 times, instead of 3).

Again, as I'm new user I don't know if I'm doing everything fine :)

Download
B
2
G
2
Posts: 3
Reputation: 1,006

Post » Thu Aug 25, 2011 3:22 pm

It's not a bug, it's how you've written the events. I wouldn't advise you activate and deactivate groups of events like that - it looks like you're trying to use them as functions, but they work more like a big "if group of events is activated" statement.

What you've done works like this:

1. Bullet collides with plane -> the "PlaneHit" group activates.
2. In PlaneHit: If the plane health is <= 0, it destroys with an explosion.
3. In PlaneHit: the next event is empty, so 'subtract 1 from health' affects all the planes. That's where your problem is. It doesn't remember the affected plane because it's an entirely different event.

To make sure you reference the right objects, put the actions in the relevant event, and use subevents beneath that. Have you tried the beginner's guide? It shows how to take health off the ghosts and destroy them correctly, like you're trying to do with the planes.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,580

Post » Thu Aug 25, 2011 3:26 pm

Thanks for answer I will definetly check the guide :]
B
2
G
2
Posts: 3
Reputation: 1,006


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 3 guests