regenerating health
igpxnaruto4
Member Posts: 81
So i have an actor that moves around, i also have an enemy that follows the x and y coords. so when they touch it takes off 25 health off of the 100. what i did to make it regenerate health was...
i made a rule (attribute), and used the variable with 100 (also used to display health and linked to the enemy and stuff) then i added a timer of every 1 second (tried 3 and 5 also) then i added a change attribute and said if health is less then 100 (also tried less then or equal to 99) then game.health+1
When i go in game the health is taken off then after 1 second the health disappears and doesn't work anymore so the bad guys can hit me as much as they want. any idea?
i made a rule (attribute), and used the variable with 100 (also used to display health and linked to the enemy and stuff) then i added a timer of every 1 second (tried 3 and 5 also) then i added a change attribute and said if health is less then 100 (also tried less then or equal to 99) then game.health+1
When i go in game the health is taken off then after 1 second the health disappears and doesn't work anymore so the bad guys can hit me as much as they want. any idea?
Best Answer
-
jckmcgraw Posts: 647@igpxnaruto4
What I said works fine for me. It must be some other conflicting rules. Here is the test file I made.
http://dl.dropbox.com/u/16233669/regenerate health demo.gameproj.zip
Hope this helps,
Jack McGraw
Answers
Rule: when main character overlaps or collides with enemies, change attribute game.health to game.health - 25
Main character: Rule: if game.health ≤ 97, timer: every x amt. of sec, change attribute game.health to game.health + 3 (or whatever)
Hope this helps,
Jack McGraw
http://i800.photobucket.com/albums/yy288/mantasceponis/myrule.png
thats what i had before, the health works except for the regen part... why?