Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / (dbp) question on how to take damage

Author
Message
warrioredge
14
Years of Service
User Offline
Joined: 19th Jan 2010
Location: Tenn
Posted: 19th Jan 2010 16:28
I need help finding a way to take damage like in old school rpg style games. (final fantasy) I figured out how to trigger my health to slowly decrease but i need help making my health take a certain amount of damage instantly and not take anymore until triggered again. as of right now my charactors health ticks away like a timer and doesnt stop until its health reaches 0, or i stop it with another trigger. i ran a search for this problem and didnt find much help.. hoping somebody could give me a hint or a example code.. thanks
Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 19th Jan 2010 23:15
Just depends on your implementation. If your trigger for taking damage is, for instance, touching an enemy, then yes, this is to be expected. The trick is to store a state: if you're not touching an enemy, the state is 0. If you touch an enemy, change the state to one. If you touch the enemy, AND the state is at 0, take some damage, THEN, change the state to 1.

"everyone forgets a semi-colon sometimes." - Phaelax
chafari
Valued Member
18
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 20th Jan 2010 10:43
something like that !



learning every day

Login to post a reply

Server time is: 2024-09-28 14:25:55
Your offset time is: 2024-09-28 14:25:55