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 / Registering Damage..

Author
Message
Sir Spaghetti Code
20
Years of Service
User Offline
Joined: 12th Jul 2004
Location: Just left of Hell
Posted: 14th Aug 2004 00:19 Edited at: 14th Aug 2004 02:32
I'm trying to register damage on the main character. What I am trying to figure out: How do I set it so that when my enemy character is performing it's attack animation and it touches the player, I can register damage? And then I would like to know how to do the oppisite as well, such as when my player is in his attack animation and touches the enemy, I can register damage on it. Here is the code:

Any help would be very appreciated! Thanks in advance!

P.S.- Oh yeah... I 'm using Nuclear Glory Collision! Thanks!

"I attribute the quarrelsome nature of the Middle Ages young men entirely to the want of the soothing weed."
-Jerome K. Jerome(1859-1927),Writer
lickuidstylz
20
Years of Service
User Offline
Joined: 13th Aug 2004
Location: MD in USA
Posted: 14th Aug 2004 04:57
At the risk of sounding like a moron, (if this is a 2d fighter)I'd say tell DB to run a check to see if the animation is active, and if p1 is in hit proximity of the enemy. eg:

if ((p1animation is playing) and (p1x# + p1radius# >= NMEx# - NMEradius#) or (p1x# - p1radius# <= ENMx# + NMEradius#)) then
NMEhitpoint# = NMEhitpoints# -1
endif

Of course this wouldn't be the actual code to insert, but its just something to quickly illustrate my point. if the player is in the vicinity of the NME (lol) and he's fighting, the enemys hitpoints will decrease. Although I'm not sure if I'm helping(I really hope I am), it sounds to me that it's a simple issue of subtracting a HP variable while either character is in the radius of any danger(also while a particular animation is in play)...

Am I a nerd just cuz I wanna make videogames to beat my friends in??

Login to post a reply

Server time is: 2024-09-22 20:19:20
Your offset time is: 2024-09-22 20:19:20