예제 #1
0
파일: Arena.cs 프로젝트: emre801/GameGame
        /**
         * Constructor
         */
        public Arena(Game g, GameMode mode)
            : base(g)
        {
            this.mode = mode;
            Init();
            bounds = new Rectangle(0, 0, (int)Constants.GAME_WORLD_WIDTH, (int)Constants.GAME_WORLD_HEIGHT);
            this.scale = (float)Constants.GAME_WORLD_WIDTH / (float)background.index.Width;
            player1.LoadContent();
            background = game.getSprite("clouds");
            maxLeft = game.maxLeft;
            maxRight = game.maxRight;
            maxTop = game.maxTop;
            maxButtom = game.maxButtom;
            gui = new GUI(g);
            buttons = new Button[g.blockCounter-9];
            int bCounter = 0;

            foreach (String i in g.blockList)
            {
                Button b ;
                if(bCounter%3==0)
                    b = new Button(g, new Vector2(10, (5 + 50 * bCounter)/3), bCounter, i);
                else if(bCounter%3==1)
                    b = new Button(g, new Vector2(50, (5 + 50 * (bCounter-1))/3), bCounter, i);
                else
                    b = new Button(g, new Vector2(90, (5 + 50 * (bCounter - 2)) / 3), bCounter, i);
                //gamaddEntity(b);
                buttons[bCounter] = b;
                bCounter++;
            }
            deathBall = game.getSprite("deathBall");
        }
예제 #2
0
        public CutScene(Game g, int cutSceneNumber)
            : base(g)
        {
            this.cutSceneNumber = cutSceneNumber;
            game.cutScene = cutSceneNumber;
            if (this.cutSceneNumber > Constants.TOTAL_NUMBER_OF_WORLDS)
                this.cutSceneNumber = Constants.TOTAL_NUMBER_OF_WORLDS;
            addCurrentPictures();
            player1 = game.playerOneInput;
            LoadContent();
            isVisible = true;
            keyInput = new KeyboardInput();

            if (!Constants.FULLSCREEN)
            {
                curHeight = GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Height;
                curWidth = GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Width * 0.5f;

            }
            else
            {
                curHeight = GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Height + 10f;
                curWidth = GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Width+40;

            }
            if (cutSceneNumber > Constants.TOTAL_NUMBER_OF_WORLDS)
            {

                cutSceneNumber = Constants.TOTAL_NUMBER_OF_WORLDS;
            }

            gui = new GUI(game);
            game.aButtonValue = 0;
            createCutScene();
            game.orderNumber = 0;
            game.hackyGuiThing = true;
        }