Hi guys.
Hi need a little help here. I’m creating a game where I have one MC for the map (mcMap), other MC for the player mark (mcPlayer).
There are 4 Players, and all of them are Childs of the mcMap.
The players can move in a limited distance in any direction (circular area), and cannot go outside the map. I want a circle to appear (with alpha) showing the draggable area to the player.
I already tried the following code, but it only works for rectangular area, and is not limited to the map.
var rectangle:Rectangle = new Rectangle(markPlayer1.x, markPlayer1.y, 200, 150);
stage.addEventListener(MouseEvent.MOUSE_DOWN, mouseStartDrag);
function mouseStartDrag(motion:MouseEvent):void {
markPlayer1.startDrag(false, rectangle);
}
stage.addEventListener(MouseEvent.MOUSE_UP, mouseStopDrag);
function mouseStopDrag(motion:MouseEvent):void {
markPlayer1.stopDrag();
}
Can anyone help me?