Ejemplo n.º 1
0
    public CSurvivalState(CInfo stageInfo)
    {
        CGame.inst().setImage("Sprites/level_Background00");
        CurrentStageData.clearData();
        SoundList.instance.playLevelMusic();
        tryAgainInfo = stageInfo;
        switch (stageInfo.Kaiju)
        {
        case 1:
            monster = new Dinosaur(stageInfo.startStage, stageInfo.firstStage, stageInfo.secondStage);
            break;

        case 2:
            monster = new Kong(stageInfo.startStage, stageInfo.firstStage, stageInfo.secondStage);
            break;

        case 3:
            monster = new Kraken(stageInfo.startStage, stageInfo.firstStage, stageInfo.secondStage);
            break;
        }
        current_state = STATE_PLAYING;
        CurrentStageData.difficulty = 0;
        mBoard = new Board(1);

        building = new Enemy(0);


        timeLeft = new CText("Time: ", CText.alignment.TOP_CENTER);
        timeLeft.setX(0);
        timeLeft.setY(0);
        timeLeft.setColor(Color.black);

        scoreText = new CText("SCORE :", CText.alignment.TOP_CENTER);
        scoreText.setX(400);
        scoreText.setY(0);
        scoreText.setColor(Color.black);
        btnNextScreen = new CSprite();
        btnNextScreen.setSortingLayer("TextUI");

        mBoard.targetScore = stageInfo.TargetScore; // MOVE TO CLASS
        float scoreCoefficient = (float)70 / (float)mBoard.targetScore;

        skills = new SkillBar(stageInfo.Kaiju);
        mTimer = new Timer();
        CurrentStageData.assignData(monster, mBoard, scoreCoefficient, skills);
        CurrentStageData.assignTimer(mTimer);
        screenDim = new CSprite();
        screenDim.setSortingLayer("ScreenShade");
        screenDim.setName("Sombra");
        backMenuBttn = new CSprite();
        backMenuBttn.setSortingLayer("TextUI");
        tryAgainBttn = new CSprite();
        tryAgainBttn.setSortingLayer("TextUI");
        optionsBttn = new CSprite();
        optionsBttn.setImage(Resources.Load <Sprite>("Sprites/Buttons/Pause_Button"));
        optionsBttn.setXY(680, 40);
        optionsBttn.setSortingLayer("TextUI");
    }
Ejemplo n.º 2
0
    public CLevelState(int stageNumber)
    {
        SoundList.instance.playLevelMusic();
        CInfo stageInfo = LevelsInfo.getLevel(stageNumber);

        CGame.inst().setImage("Sprites/level_Background0" + stageInfo.building.ToString());
        CurrentStageData.currentStage = stageNumber;
        switch (stageInfo.Kaiju)
        {
        case 1:
            monster = new Dinosaur(stageInfo.startStage, stageInfo.firstStage, stageInfo.secondStage);
            break;

        case 2:
            monster = new Kong(stageInfo.startStage, stageInfo.firstStage, stageInfo.secondStage);
            break;

        case 3:
            monster = new Kraken(stageInfo.startStage, stageInfo.firstStage, stageInfo.secondStage);
            break;
        }
        current_state = STATE_PLAYING;
        CurrentStageData.difficulty = stageInfo.dif;
        mBoard = new Board(0);
        //monster = new Kong(1, 53, 76);
        building = new Enemy(stageInfo.building);
        mText    = new CText("TEST", CText.alignment.TOP_CENTER);
        mText.setX(0);
        mText.setY(0);
        mText.setColor(Color.black);



        mBoard.movementsLeft = stageInfo.movements;   // MOVE TO CLASS
        mBoard.targetScore   = stageInfo.TargetScore; // MOVE TO CLASS
        float scoreCoefficient = (float)70 / (float)mBoard.targetScore;

        skills = new SkillBar(stageInfo.Kaiju);
        CurrentStageData.assignData(monster, mBoard, scoreCoefficient, skills);
        screenDim = new CSprite();
        screenDim.setSortingLayer("ScreenShade");
        screenDim.setName("Sombra");
        backMenuBttn = new CSprite();
        backMenuBttn.setSortingLayer("TextUI");
        tryAgainBttn = new CSprite();
        tryAgainBttn.setSortingLayer("TextUI");
        btnNextScreen = new CSprite();
        btnNextScreen.setSortingLayer("TextUI");
        optionsBttn = new CSprite();
        optionsBttn.setImage(Resources.Load <Sprite>("Sprites/Buttons/Pause_Button"));
        optionsBttn.setXY(680, 40);
        optionsBttn.setSortingLayer("TextUI");
    }