![]() |
key combo!
I was looking to step out the regular onKeyPressed(code, key) boundaries.
How would you do a combination, or sequence to preform an action? example 'A' 'A' 'S' then action is preformed. or example 'down' 'right' 'A' then action is preformed so you HAVE to hit the keys in that order for the "if" statement to be true to run the actions after it. |
You'll have to cache key strokes for that. For "A A S", start by checking if the player hits A. The next time he hits a key, check if it's "A" again and if the time passed since the last key stroke is not too long (some sort of timeout, up to you). Do that again but this time for the "S". If everything's fine, do whatever you want to do.
|
Something like this should work:
PHP Code:
|
Quote:
|
| All times are GMT +2. The time now is 01:31 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.