PDA

View Full Version : movement questions


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;
}
}

Darcey
04-21-2006, 01:29 PM
1. Make sure your movie frame rate is set quite high for more aqurate and smother animation.

2). Detect if key down... If key down,, Turn off drag so mouse doesnt lock key movement..



Experimentation is the key to all....
Good lucky