zach12
September 19th, 2007, 10:38 AM
HI
i'm a bit of newby at javascript
and have coded a lil RPG game
but i'm trying code a script that will open a link when you hit the 3 key
function getkeypress(keypress) {
keyp = (isNS || isNS6) ? keypress.which : window.event.keyCode;
if (keyp == 56) p1y = -1; //K8
if (keyp == 50) p1y = 1; //K2
if (keyp == 52) p1x = -1; //K4
if (keyp == 54) p1x = 1; //K6
if (keyp == 55) {p1x = -1;p1y = -1;} //K7
if (keyp == 57) {p1x = 1;p1y = -1;} //K9
if (keyp == 49) {p1x = -1;p1y = 1;} //K1
if (keyp == 51) //k3
return false;
}
if you could give me a hand with this
thanks
i'm a bit of newby at javascript
and have coded a lil RPG game
but i'm trying code a script that will open a link when you hit the 3 key
function getkeypress(keypress) {
keyp = (isNS || isNS6) ? keypress.which : window.event.keyCode;
if (keyp == 56) p1y = -1; //K8
if (keyp == 50) p1y = 1; //K2
if (keyp == 52) p1x = -1; //K4
if (keyp == 54) p1x = 1; //K6
if (keyp == 55) {p1x = -1;p1y = -1;} //K7
if (keyp == 57) {p1x = 1;p1y = -1;} //K9
if (keyp == 49) {p1x = -1;p1y = 1;} //K1
if (keyp == 51) //k3
return false;
}
if you could give me a hand with this
thanks