Page 1 of 1

health minus attack

PostPosted: Wed Jun 20, 2007 10:34 pm
by zygoth
I want an actor's health on a collision to equal enemyhealth-shotattack
here is my code:
__________________________
on collision

enemy1health=enemy1health-shotattack
_________________________________
where enemy1health and shotattack are integer actor variables

For some reason whenever I insert this code, no matter how many times I hit the enemy, it doesn't die. I have enemy1health set to 5 and shotattack set to 1. And yes, i have an event for ---if (enemy1health == 0) destroyactor enemy1[/code]

PostPosted: Wed Jun 20, 2007 11:45 pm
by Sgt. Sparky
look at my fighting Demo:
http://game-editor.com/forum/tp-3579-Fi ... Game-.html
it has enemy health. :D

PostPosted: Thu Jun 21, 2007 2:03 am
by pixelpoop
after you type in your code and press the OK button do you get any error messages?

PostPosted: Thu Jun 21, 2007 3:28 am
by Sgt. Sparky
pixelpoop wrote:after you type in your code and press the OK button do you get any error messages?

No,
but you can't just copy and paste it,
you must create/declare the variables and change it to match your actors. :D