PDA

View Full Version : the keydown events


Geovanie Legend
06-09-2001, 01:41 AM
Could someone be kind enough to post a list of the keydown's.. like thos
0 = a
or whatever each keydown numeric form corrisponds with in letters

Geovanie Legend
06-09-2001, 01:48 AM
I mainly need the keydown's for the following buttons
Z, X, C, and V

WhoopA
06-09-2001, 01:52 AM
There are no keydowns for those buttons. These are the only ones available:

0- Up
1- Left
2- Down
3- Right
4- D
5- S
6- A
7- M
8- Tab
9- Q
10- P

Geovanie Legend
06-09-2001, 01:58 AM
Ugh, that sucks.. well thanks anyway =)

Geovanie Legend
06-09-2001, 02:41 AM
Ok so tell me then, why don't this work?

if (playery=>6&&keydown(5)) {
playerdir=up;
playery=playery-0.5;
}

KJS
06-09-2001, 03:19 AM
it should be

playerdir=0;

Geovanie Legend
06-09-2001, 03:22 AM
Ok i tried...
if (playery=>6&&keydown(5)) {
playerdir=0;
playery=playery-0.5;
}
but it still don't work.. what it's suppose to be doing is move the player up by 0.5 notches every time they press S

Thak2
06-09-2001, 03:59 AM
need a Timeout in there :)


if (playerenters ||timeout ) {
timeout = 0.05;
}
if (timeout&&playery=>6&&keydown(5)) {
playerdir=0;
playery=playery-0.5;
timeout=0.05;
}

note: you can substitute playerenters with anyother thing you want...

Geovanie Legend
06-09-2001, 04:17 AM
Ok thanks, i got it working, but one thing still isn't right.. the player can just hold down the button and move up, i want them to have to repeatedly press the button so the faster the press it the faster they move, and the slower the press it the slower they move. i'd post what i have, but i don't want anyone to steal it =)

KJS
06-09-2001, 04:27 AM
ok to check if they have the key up do something like this
if(keydown(<numb>) && this.keydown==0){
this.keydown=1;
//do rest of the coding
}
if(!keydown(<numb>) && this.keydown==1)
this.keydown=0;

Geovanie Legend
06-09-2001, 04:43 AM
Ok i added that and it still didn't work, you can just hold down the button and move =(

KJS
06-09-2001, 05:03 AM
I dunno...

oh..

do you
disabledefmovement?

so they cant hold up...

so they have to press the button...

Geovanie Legend
06-09-2001, 05:04 AM
yep i done that, lol

KJS
06-09-2001, 05:12 AM
I dunno I would have to see your script

Tyhm
06-09-2001, 06:03 AM
if(keydown(5)){
if(this.keydown==0){
this.keydown=1;
...
}
}else this.keydown=0;

KJS
06-09-2001, 06:06 AM
that shouldn't matter if it says
elseif
or
if

LiquidIce00
06-10-2001, 09:19 AM
if you want it to be the more you press the faster it goes..
like if you keep pressing it really fast then I suggest you do some sort of speed string .. which adds +.5 or whatever every time the player has the key down and has a max value .. like 3 or whatever.. and also it would have to take out .5 when there is no key down
shouldnt be hard to make. I'd do it but I'm too lazy, too busy and sun burn hurts

T-Squad
06-10-2001, 11:08 AM
actually it does matter with else...
basicly without else, it will do everything instantly....

for istance try doing weapon fired, and making it go something like:
if (weaponfired) {
if (this.on = 1) {
this.on = 0;
}else{
if (this.on = 0) {
this.on = 1;
}
}
}

then have another going:

if (weaponfired) {
if (this.on = 1) {
this.on = 0;
}
if (this.on = 0) {
this.on = 1;
}
}

and you will see what i mean ;-)