Topic: Game Programming /
Adding levels to Shootorial final?
I was wondering how I would go about adding levels to the Shootorial. Specifically, I would want to edit variables for EnemyShip and have new images/variables for the Bosses that I create. I’ve read about going from scene to scene and found this code:
root.gameOverMenu.visible = false;
root.gameOverMenu.playAgainButton.visible = false;
root.gameOverMenu.playAgainButton.onPress = function()
{
_root.ship.newGame();
}
_root.gameOverMenu.nextLevel.visible = false;
_root.gameOverMenu.nextLevel.onPress = function()
{
gotoAndStop(“scene 2” , 1)
}
the go down to the winGame function & say:
function winGame()
{
_root.backgroundMusic.stop
_root.gameOverMenu.winLogo.text = “Misson Completed”;
_root.kongregateStats.submit(“GameWon”, 1);
_root.missionCompletedBanner.gotoAndPlay(2);
this.visible = false;
destroyAllEnemies();
gameOver();
_root.gameOverMenu.nextLevel.visible = true;
_root.gameOverMenu.nextLevel.onPress = function()
{
gotoAndStop(“scene 2” , 1)
}
_root.ship.onLoad.bossCountdown = 3;
_root.ship.onLoad.miniBossTimer = 0;
}
But I was wondering if anyone has any input otherwise. Thanks in advance.
|