-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.

LittleBobbyTables - Au Revoir
  • 32,008
  • 25
  • 109
  • 114
  • Without seeing your code, we can't tell you much more than "dispatch an even when the dice finish rolling and move the chip then" – Josh Aug 16 '13 at 18:00

1 Answers1

0

What I have understood from your argument:

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
}
Raghav
  • 3
  • 4