Street Fighter style issues

Started by
9 comments, last by Dravidian Kayne 19 years, 11 months ago
quote:Original post by Jiia
The trick is not to pay attention to buttons in-between buttons.

Keep a list of the last 10 or so buttons pressed, with the time they were pressed included. When the player presses a trigger button (punch, kick), run through the list backwards and check the keys. Check for the last sequence direction first, then search for the next-to-last. Compare the times in-between the keys, but don''t pay attention to keys not included in the sequence.

This is, so far, the best solution posted. Buffer the buttons pressed, and check if it contains a move or not. So you could do something like this:

const ButtonBuffer HADOKEN_MOVE("D","DF","F");

if ( buttons_pressed.contains(HADOKEN_MOVE) )
{
// do hadoken
}

This topic is closed to new replies.

Advertisement