Example #1
0
    public Game()
    {
        visible = false;

        game             = this;
        UserData.game    = this;
        FX.game          = this;
        Level.game       = this;
        TitleMenu.game   = this;
        RoomPainter.game = this;
        RoomPalette.game = this;

        //CONVERSION - nothing really to do here
        // detect allowScriptAccess for tracking
        //allowScriptAccess = ExternalInterface.available;
        //if(allowScriptAccess){
        //    try{
        //        ExternalInterface.call("");
        //    } catch( Exception e){
        //        allowScriptAccess = false;
        //    }
        //}

        Library.initLevels();

        // init UserData
        UserData.initSettings();
        UserData.initGameState();

        //CONVERSION - too early for this - need to load from StorageManager
        //UserData.pull();
        //// check the game is alive
        //if(UserData.gameState.dead) UserData.initGameState();

        state = TEST_BED_INIT ? GAME : MENU;

        // init sound
        SoundManager.init();
        soundQueue = new SoundQueue();

        if (stage != null)
        {
            addedToStage();
        }
        else
        {
            addEventListener(Event.ADDED_TO_STAGE, (Action1 <Event>)addedToStage);
        }
    }
Example #2
0
 public void selectSound()
 {
     SoundManager.playSound("chirup");
 }