Beispiel #1
0
        // Constructor:
        public S_Board(GameStateManager creator, float xPos, float yPos) : base(creator, xPos, yPos)
        {
            cameraProperties = new CameraProperties();

            this.gameOptions = creator.gameOptions;

            //DEBUG:
            if (creator.gameOptions.numRounds < 1)
            {
                this.numRounds = 1;
            }
            else
            {
                this.numRounds = gameOptions.numRounds;
            }

            parentManager.boardGame = this;

            // Create testDice
            testDice = new E_Dice(this, parentManager.game.spr_testDice, MGP_Constants.SCREEN_MID_X, MGP_Constants.SCREEN_MID_Y, 10);


            // Start first round:
            S_Round newRound = new S_Round(parentManager, 0, 0);

            parentManager.AddStateQueue(newRound);
            this.round = newRound;
        } // end constructor
Beispiel #2
0
        // Constructor
        public S_RollDice(GameStateManager creator, float xPos, float yPos) : base(creator, xPos, yPos)
        {
            currPlayer     = parentManager.round.currPlayer;
            dice           = parentManager.boardGame.testDice;
            playerSelected = false;
            bounceUp       = false;
            bounceDown     = false;
            rollTime       = 60 / ROLL_SPEED;              // Start rolling right away
            parentManager.boardGame.testDice.diceRoll = 1; // start dice at 1;

            compRollBegin = 0;
            compRollEnd   = creator.random.Next(ROLL_SPEED, ROLL_SPEED * 2); // have computer 'hit the dice' after 1 - 2 secs
            waitTime      = 0;

            // Sound Effects:
            creator.audioEngine.playSound(MGP_Constants.soundEffects.dicePre, 1.0f);
            rollingSoundCounter = PRE_ROLL_SOUND_LEN;
        }