Esempio n. 1
0
        void ChoosePaddle(int paddleNumber)
        {
            Paddle newPaddle = new Paddle();

            if ((paddleNumber == 0) && (shop.availableItems[paddleNumber] == true))
            {
                newPaddle = new YellowPaddle();
                yellowPaddle.SetActive();
                state = GameState.LEVEL_MENAGER;
            }
            else if ((paddleNumber == 1) && (shop.availableItems[paddleNumber] == true))
            {
                redPaddle.SetActive();
                newPaddle = new RedPaddle();
                state     = GameState.LEVEL_MENAGER;
            }
            else if ((paddleNumber == 2) && (shop.availableItems[paddleNumber] == true))
            {
                greenPaddle.SetActive();
                newPaddle = new GreenPaddle();
                state     = GameState.LEVEL_MENAGER;
            }
            else if ((paddleNumber == 3) && (shop.availableItems[paddleNumber] == true))
            {
                bluePaddle.SetActive();
                newPaddle = new BluePaddle();
                state     = GameState.LEVEL_MENAGER;
            }
            else if ((paddleNumber == 4))
            {
                state = GameState.LEVEL_MENAGER;
            }
            paddleChooser.SetNewPlayer(player, newPaddle);
        }
Esempio n. 2
0
        void CheckBuyingItems(Vector2f mouse)
        {
            Paddle newPaddle;

            switch (shop.Update(mouse, ref window))
            {
            case 0:
                newPaddle = new YellowPaddle();
                shop.BuyPaddle(ref newPaddle, ref amountOfCoins);
                break;

            case 1:
                newPaddle = new RedPaddle();
                shop.BuyPaddle(ref newPaddle, ref amountOfCoins);
                break;

            case 2:
                newPaddle = new GreenPaddle();
                shop.BuyPaddle(ref newPaddle, ref amountOfCoins);
                break;

            case 3:
                newPaddle = new BluePaddle();
                shop.BuyPaddle(ref newPaddle, ref amountOfCoins);
                break;

            default: break;
            }
        }