Attack System Questions ( Frames ).

Post your questions, suggestions and experiences regarding game design, integration of external libraries here. For irrEdit, irrXML and irrKlang, see the
ambiera forums
Post Reply
xsocom
Posts: 80
Joined: Thu Sep 13, 2007 8:34 am

Attack System Questions ( Frames ).

Post by xsocom »

Hello, I have a question about how you would do a simple attack system (Player attacks Monster), if we consider its a single player now, so you attack based on the number of frame played at the moment the attack comes? For example.

Attack animation is in the range of 20-40.

When this "Animation Playing" and it will come to "The hit frame" sensitive around the frame 30.

So should I make a check on the frame, and when it strikes 30, so do it harm etc.

Or do you guys use some sort of timer based attack system like.

Code: Select all

if ((pDevice->getTimer()->getTime()-pEntity->attackTimer)>(1500/(pEntity->attackspeed/100)))
{
........
}
This is a very simple thought, but how would you make an attack system?

Thanks guys.
fmx

Post by fmx »

i suppose either way would work (frames or times), but IMO using actual times is probably better because it would account for interpolation etc.

or you could try a hybrid system to be even *more* precise, starting the timer after 28 frames or so (rather than at the beginning of the animation) and checking from there

its how I would do it anyway
:P
xsocom
Posts: 80
Joined: Thu Sep 13, 2007 8:34 am

Post by xsocom »

Allright =) Thanks
Post Reply