bringer0death
04-19-2006, 03:44 PM
i have a question about movement controls. i have a mask that moves to the mouse right now but i want to make it move to the mouse and the keyboard. it is going to adventully become a cheap version of a sniper game so i wanted to be able to control it both ways so i can have 100% deadly accuracy.
pasted here is the code that i tought should work but it didn't. if anyone can help please help me.
thank you
~~Kyle
onClipEvent (load) {
moveSpeed = 10;
}
onClipEvent (enterFrame) {
startDrag(this, true);
if (Key.isDown(Key.RIGHT)) {
this._x += moveSpeed;
} else if (Key.isDown(Key.LEFT)) {
this._x -= moveSpeed;
}
if (Key.isDown(Key.DOWN)) {
this._y += moveSpeed;
} else if (Key.isDown(Key.UP)) {
this._y -= moveSpeed;
}
}
pasted here is the code that i tought should work but it didn't. if anyone can help please help me.
thank you
~~Kyle
onClipEvent (load) {
moveSpeed = 10;
}
onClipEvent (enterFrame) {
startDrag(this, true);
if (Key.isDown(Key.RIGHT)) {
this._x += moveSpeed;
} else if (Key.isDown(Key.LEFT)) {
this._x -= moveSpeed;
}
if (Key.isDown(Key.DOWN)) {
this._y += moveSpeed;
} else if (Key.isDown(Key.UP)) {
this._y -= moveSpeed;
}
}