Make enemy untargetable after it dies

This is what I see, the object doesn’t exist:

Did you add a text object to your scene? (this is the one I called playerhealth btw).

You create that and place it in your scene. Then you can access it like other objects (e.g. sprites) and modify its text.

Nope, I didn’t do that. Thanks for explaining. I still don’t understand how a text object will do what I want, but ok.

The text object is just displaying text on the screen. It does not do anything for making the boss not being hit by the bullets anymore.

You just need to set a healthscore for your boss (if you display it or not is up to you). If the health score is bigger than or equal to 1, and (as a subevent of this condition) if the bullets collide with the boss, the health score is being reduced and the bulllets are deleted.
If the health score is equal to 0 than something else happens and the bullets do not collide anymore with your boss (or more precise the collision is not checked and the bullets are not deleted).

So, the collision condition and the resulting actions (reducing health, deleting the bullet) happen only if the value of the variable enemyhealth is bigger or equal to 1. They are subevents of the main event (the value of the variable).

Ok, that’s starting to make sense. So if I follow the pictures you posted, is there still more coding to do to get it all working? If so maybe I can pick it up tomorrow.

Perhaps a tutorial on creating a space scrolling shooter can help you - link. The main points are described there, and you can modify it for yourself.

1 Like

That should be all. I just put it quickly together but it works. What beanmatt suggested is certainly the cleaner way.
And @E1e5en is right, the space shooter tutorial could be a good resource for becoming comfortable with variables and other things you might need for your shmup.

Thanks. I’ll check it out.

1 Like

Thanks, Drona. I’ll have to pick this up tomorrow to see if I can get it working.

1 Like