Just record the keys the player has pressed in a buffer which can hold X number of kays, where X is your most complicated move.
This buffer should rotate each time a key is added. In other words, when you want to add a key, move every key one to the left, which deletes the oldest key press, and then stick the new key on the end.
Ie:
Then every loop, scan through that buffer, and determine if there are any groups of keys which represent a special move. If there are, activate the move, and clear the part of the buffer that contained it so it doesn't get triggered again.
You can get a lot more complicated than this if you want moves which are based on how long you hold down a particular direction, but for basic moves, even joystick based, this method should suffice.
It also occurs to me that can make things a little easier for yourself if you store the keys in a string. Then you can use INSTR() to find a group of moves in the string that matches the ones available. You don't even need to use ascii characters, because you can store scan codes in a string with chr$(scancode)
This buffer should rotate each time a key is added. In other words, when you want to add a key, move every key one to the left, which deletes the oldest key press, and then stick the new key on the end.
Ie:
Const KEYBOARD_BUFFER_SIZE = 10 Dim Keyboard_Buffer(KEYBOARD_BUFFER_SIZE) ; When a key you are scanning for is pressed: ; Rotate buffer to left. Oldest key is lost. For Loop = 1 to KEYBOARD_BUFFER_SIZE-1 Keyboard_Buffer(Loop-1) = Keyboard_Buffer(Loop) Next ; Add new key to end of buffer. Keyboard_Buffer(KEYBOARD_BUFFER_SIZE) = NewKey
Then every loop, scan through that buffer, and determine if there are any groups of keys which represent a special move. If there are, activate the move, and clear the part of the buffer that contained it so it doesn't get triggered again.
You can get a lot more complicated than this if you want moves which are based on how long you hold down a particular direction, but for basic moves, even joystick based, this method should suffice.
It also occurs to me that can make things a little easier for yourself if you store the keys in a string. Then you can use INSTR() to find a group of moves in the string that matches the ones available. You don't even need to use ascii characters, because you can store scan codes in a string with chr$(scancode)