Menu

Enemy health

2005-02-10
2012-12-25
  • Nobody/Anonymous

    How do make it so that when you shoot a sprite he doesn't dissappear on the first hit but instead on the second or third hit depending on how tough I want the sprite to be. Do you somehow give them health or does it have something to do with the shooting script?

     
    • Ed

      Ed - 2005-02-10

      This has been discussed already in other threads.  Look around, also on the EZBoard forum.  I'm sure you'll find something.

      A general overview of how to do it is:  Use lots and lots of invisible inventory items and sprite collisions.

       
    • Nobody/Anonymous

      I know this question was posted in 2005, but i thought i'd add an answer so that others would know how...
      *Create an items called ENEMY'S HEALTH.
      *create a function that will subtract -1 ENEMEYS HEALTH when needed.(this function, when depleted will delete sprite ENEMY)
      *Create a collision between your BULLET and the ENEMY that triggers -1 ENEMYS HEALTH.

      when you shoot your enemy, it will subtract -1 ENEMYS HEALTH. And when all of the the item named ENEMY'S HEALTH is gone, the enemy sprite will be deleted.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.