Forum Topic: Key Trouble - if (Key.isDown()){

(186 views • 5 replies)

This topic is 1 page long.

<< < > >>
None

Toccuma

Reply To Post Reply & Quote

Posted at: 3/31/06 10:12 PM

Toccuma NEUTRAL LEVEL 13

Sign-Up: 02/13/05

Posts: 8

I use the code:
if (Key.isDown(Key.RIGHT)) { for my characters movment, and that works fine for the right key, or other "set" keys such as pgdn, but when i try to use a key like "M" or "1" it jolts the movment of my characters, it moves once, stops, then moves as it should. The reason I have to use this "type" of code for moveing is that i need "if"s attached to it, say if (_root.playing){ ... I need the misc keys since 2 player is all squished to the side without them!!!

Also, as a secondary, saving! Ive decided that perhaps saving pictures, say, you unlocked hat 2, is impractical, but instead, Ill asign each "thing" a corisponding number... how can i save those numbers so that they remain after the window has been closed? o^-^o ???

Ah thanking you ^-^


None

MatthewB

Reply To Post Reply & Quote

Posted at: 3/31/06 10:43 PM

MatthewB LIGHT LEVEL 05

Sign-Up: 09/03/05

Posts: 819

letter keys and a few other keys on your keyboard, will respond to a corasponging number, i dunnno what the number-letter combination is, but you can look it up


None

Blaze

Reply To Post Reply & Quote

Posted at: 3/31/06 10:45 PM

Blaze LIGHT LEVEL 22

Sign-Up: 08/04/05

Posts: 6,957

At 3/31/06 10:43 PM, schnappi wrote: letter keys and a few other keys on your keyboard, will respond to a corasponging number, i dunnno what the number-letter combination is, but you can look it up

google up the ASCII table. But here is basic:

A = 65
B = 66
C = 67
...
X = 88
Y = 89
Z = 90

And its like,

if(Key.isDown(65)){}

k?


Shouting

Toccuma

Reply To Post Reply & Quote

Posted at: 4/1/06 06:18 AM

Toccuma NEUTRAL LEVEL 13

Sign-Up: 02/13/05

Posts: 8

Whoo hoo! I knew there was a trick to it! That'll make mah game so much sweeter!! I havnt tested it yet, but I beleive, thx!


None

LostVoices

Reply To Post Reply & Quote

Posted at: 4/1/06 06:23 AM

LostVoices LIGHT LEVEL 07

Sign-Up: 03/09/06

Posts: 1,498

At 3/31/06 10:45 PM, Darkfire_Blaze wrote:
At 3/31/06 10:43 PM, schnappi wrote: letter keys and a few other keys on your keyboard, will respond to a corasponging number, i dunnno what the number-letter combination is, but you can look it up

Ascii codes

Free Lessons
Paid Courses
Expert Users willing to help

BBS Signature

None

NOTmyALT

Reply To Post Reply & Quote

Posted at: 4/1/06 06:25 AM

NOTmyALT LIGHT LEVEL 02

Sign-Up: 04/01/06

Posts: 113

AS: KeyCodes by -Toast-


All times are Eastern Standard Time (GMT -5) | Current Time: 01:11 PM

<< Back

This topic is 1 page long.

<< < > >>
You need a Grounds Gold Account to post on the NG BBS! If you don't have one, click here to sign up now! It's fast, free, and easy — and opens up tons of great NG features!