How do I make the enemies take damage?

0 favourites
  • 4 posts
From the Asset Store
This sound pack features 117 game sounds : Axe,Punch Swing & Hit & Damage. This is a perfect collection for your game.

    So basically my game has been working fine in this aspect, when all of a sudden I noticed something stupid start happening. As you can see from the image that's

    how damage works. Enemies get hit by the player's bullet, they take damage and display it etc.

    But FOR SOME REASON when I start a instance of the game I can kill enemies, but then randomly after let's say "20 kills" (it's random when it kicks out) I don't deal damage anymore. It displays stuff like "-10" or "-13" over their heads but enemies I know only have 30HP are taking like 20 shots and still not dying... I haven't tampered with these events/actions since I made it because it worked fine. I have not referenced anything to do with these variables out side here other than creation of the bullet and that was made before this event. Now i'm starting to think my version of Construct 2 is bugged because this isn't the only unexplained problem i'm having without tampering with what was previously working fine.

    Thanks, Conra

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Well the important event is missing from the screenshot, what's the enemy death logic? My guess is you could have enemy health = 0 then destroy instead of less than 0 or some other reason in that area. Looks like it skips the death and carries on taking damage into the negative health.

  • Like Plinkie said, something is up with what happens at death. My guess would be that you have something like If Damage = 0 Then Die. What you really want If Damage is = or less than 0 Than Die.

    Edit: Never mind, Plinkie said the exact same thing. I need to get better glasses.

  • I have <0 as my death event, I checked the de-bugger mode and enemies were stacking up to -2000 damage, but after playing around with stuff it's not happening anymore. I don't know what caused it to stop but it's sorted now

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)