health minus attack

Talk about making games.

health minus attack

Postby zygoth » Wed Jun 20, 2007 10:34 pm

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]
User avatar
zygoth
 
Posts: 140
Joined: Mon Jun 11, 2007 6:37 pm
Score: 5 Give a positive score

Postby Sgt. Sparky » Wed Jun 20, 2007 11:45 pm

look at my fighting Demo:
http://game-editor.com/forum/tp-3579-Fi ... Game-.html
it has enemy health. :D
Image
Random Links:
viewtopic.php?p=19474#19474
Right now (10/14/2009) I'm working on some C++ projects, but I might be able to help if you have some Game Editor questions. :)
User avatar
Sgt. Sparky
 
Posts: 1850
Joined: Sat Oct 07, 2006 5:28 pm
Location: Somewhere out there, beneath the pale blue sky...
Score: 236 Give a positive score

Postby pixelpoop » Thu Jun 21, 2007 2:03 am

after you type in your code and press the OK button do you get any error messages?
User avatar
pixelpoop
 
Posts: 276
Joined: Tue Aug 29, 2006 9:32 pm
Score: 28 Give a positive score

Postby Sgt. Sparky » Thu Jun 21, 2007 3:28 am

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
Image
Random Links:
viewtopic.php?p=19474#19474
Right now (10/14/2009) I'm working on some C++ projects, but I might be able to help if you have some Game Editor questions. :)
User avatar
Sgt. Sparky
 
Posts: 1850
Joined: Sat Oct 07, 2006 5:28 pm
Location: Somewhere out there, beneath the pale blue sky...
Score: 236 Give a positive score


Return to Game Development

Who is online

Users browsing this forum: No registered users and 1 guest