|
-
....he's amazing!!!
Return of the Key class to AS3
I got bored over the weekend so I wrote this
You set it up like this:
Code:
import Key;
Key.listen(stage);
Now place it in your game loop and use it the same way you did before:
Code:
if (Key.isDown(Key.LEFT)){trace("Left cursor key is being pressed")}
From my new blog, but no-one's reading it yet, so I thought I'd post here as well. Enjoy.
-
Hi,
Useful class (even though it has been done before). Nice work. I've added you to my RSS feed aggregator. I expect high quality posts sir!
-
formerly hooligan2001 :)
Nice little class. Been thinking about making something like that for weeks. I blame my laziness. But now I don't have too. My life lesson is if you hold out long enough someone will do it for you. Thanks a bunch.
-
Hype over content...
Nice work mate, and a good start to the blog.
I'll add your link in to ours sometime tonight ( I normally screw it up so I need to build up to 30mins swearing at something which should be easy ).
Squize.
-
....he's amazing!!!
Hi Cortana, you too sir.
Yes that's pretty similar to what I had originally planned, but I wanted the syntax to be identical, and the class to be static, so you don't need to declare or create an instance, just import and activate it by giving it a stage ref.
It looks great in the IDE because "Key" is still highlighted, even if you've selected publish to AS3. 
.hooligan - We're all standing on the shoulders of giants mate, just as long as you put it to good use.
Squize - lovely, thanks! Using blogger is forcing me to do things with html/css. It reduces me to tears whenever I try and change something.
-
Senior Member
Maybe you could add way to stop listening, way to know if it is currently working and some errors in case it goes wrong.
-
....he's amazing!!!
Good suggestions. Key 2.0 will include those features.
I'm also thinking of a keylogger to replay games with and to submit with highscores for game verification (they were features we were going to implement in my last proect but didn't get time)
-
Custom User Title
 Originally Posted by Cortana
And before but cool anyway
-
....he's amazing!!!
I really should google these things before I put all the hard work in.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|