|
Masai Taringa
Registered User
Join date: 23 Oct 2006
Posts: 12
|
03-17-2007 13:53
Hi to all, I would use the control function to capture 2 or more consecutive key press, to do a fight game. I want to re-create the 'combo' concept, and using only 'page-up' and 'page-down' keys doing different combination of attack or defense. So, I would start a particular animation only when I press 2 times the 'page-up' and 1 time the 'page-down'. Or another anim when I press only 1 time the 'page-down'
Any idea ??
Thanks a lot !!! Masai
|
|
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
|
03-29-2007 05:01
From: Masai Taringa Hi to all, I would use the control function to capture 2 or more consecutive key press, to do a fight game. I want to re-create the 'combo' concept, and using only 'page-up' and 'page-down' keys doing different combination of attack or defense. So, I would start a particular animation only when I press 2 times the 'page-up' and 1 time the 'page-down'. Or another anim when I press only 1 time the 'page-down'
Any idea ??
Thanks a lot !!! Masai Translate each key press into a character and build a string to represent presses so far. Then if the last n characters of your string match your trigger requirements perform the required move/animation.
|
|
Tiarnalalon Sismondi
Registered User
Join date: 1 Jun 2006
Posts: 402
|
03-29-2007 05:12
I would advise inputting some way of clearing the string periodically...like when you complete a combo, or some other variable. A timer would be nice, but it would potentially break a correctly executed combo. Perhaps an 'idle-timer' or something that clears it after no presses for X seconds.
|
|
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
|
03-29-2007 07:28
From: Tiarnalalon Sismondi I would advise inputting some way of clearing the string periodically...like when you complete a combo, or some other variable. A timer would be nice, but it would potentially break a correctly executed combo. Perhaps an 'idle-timer' or something that clears it after no presses for X seconds. Well thats a given really, but yes I'd only keep track of the longest possible combination plus a couple of characters.
|