Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Code Snippets / 8-way movement with doubletap boost

Author
Message
Mr Tank
21
Years of Service
User Offline
Joined: 25th Nov 2002
Location: United Kingdom
Posted: 5th Dec 2006 04:37
A thing that detects when you tap or doubletap directions using the keyboard arrowkeys. It was a bit of a challenge to do with diagonals working. Not sure if my implementation is that efficient, but it seems to work OK.
Could be used for a lot of things. In this example, you get a very simple push the instant you do a doubletap.
Without much effort, you could change it so that upon double-tapping, you are put into a state (such as afterburner, or sprinting), which only ends once you finish pressing the direction.
Here's the code.



You'll be able to click on this someday.
Kaneda
17
Years of Service
User Offline
Joined: 12th Dec 2006
Location:
Posted: 13th Dec 2006 16:14
This is really nice. I really like the double tap idea, nice code mr.tank.

Signature?...Signature!!??

Login to post a reply

Server time is: 2024-11-22 22:56:30
Your offset time is: 2024-11-22 22:56:30