Wednesday, 4 June 2014

Stencyl solution

Okay today I found a solution to getting the player character's HP to fall to 0 and die from enemy hits.

In the "Run and Jump" kits behaviour "Die in Pit", I added to actor collision event which allows the enemy to hit the player and decrease the health to 0. Next I set the players HP to 100 on the same behaviour in a separate event. The HP counter is a drawing event set in the scene 1 event editor and shows up on the screen.
Now the reason why the actor when die after the countdown expired is due to accidentally disabling the health management actor behaviour from the player. Also the countdown expiration event needs to be included in the Die in pit behavior to work like the death event. Without this behaviour, the custom event wouldn't work and trigger the behaviour. So now the actor is no longer immortal, but the one thing I still don't know is why this event had to be included in this behaviour. However right now I take this as a victory and good enough solution.



No comments:

Post a Comment