The Daily Click ::. Forums ::. Klik Coding Help ::. Enemy Question

Post Reply  Post Oekaki 

Posted By Message


9th May, 2007 at 23:31:24 -

How can I create multiple copies of the same enemy without having them all die when I kill one?



Dedicated klik scientist


10th May, 2007 at 01:08:47 -

What event is destroying the object?
In the left hand column where the events are displayed, you should have at least one that refers to the specific copy of the object you want to destroy.

For example;

If Value A of Enemy <= 0,
+Then Destroy Enemy

Then it will only destroy an enemy who has its Value A less then 0.

If Bullet collides with Enemy,
+Then Destroy Enemy
+Then Destroy Bullet

This will only destroy the bullets and enemies that collide, not all the other ones.
However, if nothing in the events refers to the enemy, it will automatically refer to ALL copies of an object.
For example:

If Player presses "Space" key,
+Then Destroy Enemy

That would destroy ALL copies of the enemy when space is pressed.

Just remember, all actions will at start of reading an event, refer to all copies of that event. Then it will first go down the conditions, from top to bottom. So you can narrow down between those copies specified multiple times, until you are down to a single copy. Typically adding a "Choose Object at random" condition at the very bottom, will make sure that only 1 is destroyed at a time.

So follow this:

If X-Enemy < 100 -selects all enemies with x of less then 100
If X-Enemy > 50 -selects all enemies 50 > x > 100
If Value A Enemy = 0 -selects all enemies 50 > x > 100 & value = 0
Pick Enemy at random -selects ONE enemy 50 > x > 100 & value = 0 at random

Gridquest V2.00 is out!!

Post Reply



Worth A Click