Dec 23, 2010 at 12:45 AM

I'm about to start coding combo moves for my game. For example I've got punch->roundhouse, assuming the player gives the right inputs in time (punch, then before the animation ends, kick)

What's the best strategy for this?
One way I can think of is to check if the punch animation is still playing, and if it has passed a certain time(so the combo only occurs once the punch has hit, otherwise it would cancel it), allow the combo. The downside to this solution seems to be that it is tied very strongly to my animation package, making it completely reliant on the package's ability to accurately return the current animation time.

Another option, would be to start a timer when the punch button is pressed, and, between two specific times, representing the window of opportunity for the combo, allow a press of the kick button to trigger the roundhouse. My problem with this, is that I'm not familiar with the timer code I would need here, also it would be a 'guesstimate' of what window I should allow for the combo to complete.(I'm not as worried about the second point, as simple trial and error would probably fix that.)

Dec 23, 2010 at 1:09 PM

I really can't seem to get the hang of timers in Xen. Ideally, I'd like to be able to check if the time expired is between two values.

if(timer.Started && !timer.Expired)
But I don't know how to get at the number of milliseconds elapsed from when a button is pressed in Xen.

Jan 10, 2011 at 1:05 AM

I figured this out, I update the timer with comboTimer += state.DeltaTimeSeconds;
I had a peek into the tutorial code, it was in there all the time :s