Adding levels to Shootorial final?

3 posts

Flag Post

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.

 
Flag Post

Although I cannot help you with your issue as I cannot remember AS2 (I think my brain threw all knowledge of it away when I learnt AS3), I would recommend stop using AS2 and move to AS3. I will link you to this topic by Senekis who wrote a comprehensive list of reasons to do so, and also, you will have much more success with finding help if you have a problem in AS3, rather than AS2. Especially as you most likely only just started learning AS2, you can quit and get out before you get “stuck” in it!

LINK

 
Flag Post
Originally posted by fiddlecrab:

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:

You’re looking in the wrong place. For several reasons.

1) Scenes are bad
2) That code has nothing to do with what happens during the game (i.e. spawning bosses).