Game Development Reference
In-Depth Information
dispatchEvent(new CustomEventSound(CustomEventSound.PLAY_SOUND,
Main.SOUND_HIT_WALL, false, 1, 0));
}
//check for stuck cars=
if (player.reverse && player.velocity >.1) {
player.velocity = -1;
}else if (!player.reverse && player.velocity < .1){
player.velocity = 1;
}
trace("player.velocity=" + player.velocity);
player.velocity *= -levelWallAdjust;
player.dx *= -levelWallAdjust;
player.dy *= -levelWallAdjust;
player.move = false;
}
break;
case SPRITE_SKULL:
player.velocity *= -levelSkullAdjust;
player.dx *= -levelSkullAdjust;
player.dy *= -levelSkullAdjust;
dispatchEvent(new CustomEventSound(CustomEventSound.PLAY_SOUND,
Main.SOUND_SKULL_HIT, false, 1, 0));
break;
case SPRITE_CLOCK:
countDownTimer.seconds += levelClockAdd;
dispatchEvent(new CustomEventSound(CustomEventSound.PLAY_SOUND,
Main.SOUND_CLOCK_PICKUP, false, 1, 0));
world[row][col] = levelBackGroundTile ;
break;
case SPRITE_HEART:
heartsCollected++;
score += levelHeartScore;
dispatchEvent(new CustomEventSound(CustomEventSound.PLAY_SOUND,
Main.SOUND_HEART_PICKUP, false, 1, 0));
world[row][col] = levelBackGroundTile ;
break;
case SPRITE_GOAL:
if (heartsCollected >= heartsNeeded ) {
goalReached = true;
Search WWH ::




Custom Search