nova99
04-06-2007, 02:59 AM
ok, i just made a beta version of a game using arrow keys to move, space to jump, and shift to fire. i realize these controlls are awkward and so i wanted to figure out how to make jumping z, and shooting x. i've tried one too many tutorials and none of them seem to work.
could u tell me how to change these codes? i'd really appreciate it
function detectKeys() {
var ob = _root.char;
var keyPressed = false; //detecting key press
if (Key.isDown(Key.SPACE) and !ob.jump and !ob.climb) {
// jump
ob.jump = true;
ob.jumpspeed = ob.jumpstart;
} //jumping
if (Key.isDown(Key.SHIFT) and getTimer()>ob.lastshot+ob.shootspeed) {
_root.shoot(ob);
} //shooting
could u tell me how to change these codes? i'd really appreciate it
function detectKeys() {
var ob = _root.char;
var keyPressed = false; //detecting key press
if (Key.isDown(Key.SPACE) and !ob.jump and !ob.climb) {
// jump
ob.jump = true;
ob.jumpspeed = ob.jumpstart;
} //jumping
if (Key.isDown(Key.SHIFT) and getTimer()>ob.lastshot+ob.shootspeed) {
_root.shoot(ob);
} //shooting