Woff Posted September 26, 2014 Share Posted September 26, 2014 Hello gentlemen, let's whisk dust off our tired inquiring minds by the end of the week, and reflect on implementation of the "life line" of our characters. We are talking about the possibility of killing the player / enemy no with just one feed, but with several accurate hits.I think it would be great possibility to realize more interesting scenario. How do you make such things, and if you have examples, show it please.I found something similiar, so I will attach it bellow Link to comment Share on other sites More sharing options...
lewster32 Posted September 26, 2014 Share Posted September 26, 2014 Here is a very simple implementation of a health bar (this is typically what they're called): http://jsfiddle.net/lewster32/shodch8x/ Woff 1 Link to comment Share on other sites More sharing options...
Woff Posted September 26, 2014 Author Share Posted September 26, 2014 Here is a very simple implementation of a health bar (this is typically what they're called): http://jsfiddle.net/lewster32/shodch8x/Really it looks simple and awesome. I'll try to understand.Next step is every time when interacting with the enemy, it can be applied to certain injuries and take away life on the basis of how you have shown abovethank you. Link to comment Share on other sites More sharing options...
lewster32 Posted September 26, 2014 Share Posted September 26, 2014 If your enemy has a 'life' value, which starts at say 100, then you can set the health bar to match that value. You can then subtract as much health as you need to, and each time you do, check that the health is above 0 - if not, then your enemy is dead, and you should call the relevant routine to play the death animation and so on. Woff 1 Link to comment Share on other sites More sharing options...
Woff Posted September 27, 2014 Author Share Posted September 27, 2014 Thank you, accessible and understandable answers Link to comment Share on other sites More sharing options...
Recommended Posts