Discuss Scratch

good_animation_real
Scratcher
2 posts

Clone-based hp system. How do I make it work?

I'm currently making a shoot-em-up style game and to add hp to the enemies I just stacked clones on top of each other. However, this created 2 problems: 1. The projectiles shot out by the player don't disappear when they hit the enemy. And 2. The projectiles one shot the enemy no matter how many clones are stacked on top of each other. I've tried to fix both of these problems but I simply couldn't find a way to fix these problems. Is there a way that I can make this hp system work or do I have to remake a new hp system from the ground up?
NMario84
Scratcher
1000+ posts

Clone-based hp system. How do I make it work?

I would check your order of operations.

First, you want the player to shoot the projectile.
Then you want to check if the projectile is touching the enemies. If there is contact, then you want to make the necessary changes to the enemy HP, and remove the player projectile.

If your projectiles are not checking for touching other objects properly, then something must be in incorrect order.

The best practice for order of operations is to use a game loop, which is using a single forever loop to broadcast your events in order.


In any case, you can also check out Griffpatch's youtube tutorial series. He has a series on Lemonoids, which is basically what you are describing.


Powered by DjangoBB