-2

I'm actually new to as3, and I am developing a snakes and ladders game. I already got everything working. Only thing is, when the dice is still on the roll, the chip is already on the move, advancing on each tile. For example, the random number is six. While the dice is still rolling, the chip is already advancing into the sixth tile.

How can I delay the movement of the chip? It must move only when the dice is already done rolling.

4

1 回答 1

0

我从你的论点中了解到:

var IsDiceStillRooling:Boolean=false;

function dicerooling(){
   //generate random number
   //your dice rollingcode

   //once rolling is done
    IsDiceStillRooling=true;
}

  addEventListener(Event.ENTER_FRAME, fl_EnterFrameHandler);

function fl_EnterFrameHandler(event:Event):void
{
   if(IsDiceStillRooling==true) chipRolling();
}

function chipRolling():void
{
   //start chip rolling
}
于 2013-08-16T19:29:24.970 回答