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 / [DBP]+[Matrix1Utils] Multi-Key Input System with Events

Author
Message
DigitalFury
13
Years of Service
User Offline
Joined: 30th Jul 2010
Location: United States
Posted: 1st Dec 2010 20:45 Edited at: 15th Sep 2012 00:56
I put together an set of scan input functions. If a key is pressed, released, or down the respective function is called. The function calls are automatic. This saves a lot of writing of "if/then" statements. All the functions are organized by which key and the event of that key, making it a very organized method.

DBP Example:
Removed!

Current Problem:
The problem is the Keyboard function can't be in a coroutine. It skips checking some keys. What I need is an alternative way to scan for input. Scancode doesn't work for scanning input!

This snippet is used in my project Zombie Project: Early WIP.

Any comments, questions, or bugs let me know. Don't forget to credit me if you use any of my code.

DigitalFury

DigitalFury
13
Years of Service
User Offline
Joined: 30th Jul 2010
Location: United States
Posted: 4th Dec 2010 23:55 Edited at: 29th Jan 2011 01:10
This input class is being completely rewritten. Check the Game Template.

Login to post a reply

Server time is: 2024-03-29 09:08:56
Your offset time is: 2024-03-29 09:08:56