Game Development Reference
In-Depth Information
for (var c:int = 0; c < board[r].length; c++) {
tempDie = board[r][c];
if (tempDie != null) {
if (tempDie.isFalling || tempDie.isFading) {
tempDie.render();
}
}
}
}
}
private function fadeDice():void {
var boardLength:int = board.length;
for (var r:int = 0; r < boardLength; r++) {
for (var c:int = 0; c < board[r].length; c++) {
tempDie = board[r][c];
if (tempDie != null) { //Changed Die Battle
tempDie.startFade((Math.random()*.9)+.1);
}
}
}
}
private function makeDiceFall():void {
var boardLength:int = board.length;
for (var r:int = 0; r < boardLength; r++) {
for (var c:int = 0; c < board[r].length; c++) {
tempDie = board[r][c];
if (tempDie != null) { //Changed Die Battle
tempDie.startFalling(gameHeight + DIE_HEIGHT, (Math.random()*15)+10);
}
}
}
}
private function removeDie(rd:Die):void {
var boardLength:int = board.length;
for (var r:int = 0; r < boardLength; r++) {
for (var c:int = 0; c < board[r].length; c++) {
tempDie = board[r][c];
if (tempDie == rd) {
tempDie.removeEventListener(CustomEventClickDie.EVENT_CLICK_DIE,
dieClickListener);
tempDie.dispose();
removeChild(tempDie);
board[r][c]= null;
}
}
}
}
private function cleanUpLevel():void {
var boardLength:int = board.length;
for (var r:int = 0; r < boardLength; r++) {
Search WWH ::




Custom Search