예제 #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 TitleScreen(Game g)
            : base(g)
        {
            sprBackground = game.getSprite("arena");
            sprLogoText = game.getSprite("RageQuit");
            sprLogoGear = game.getSprite("titleScreenElement.1");
            sprSelectInner = game.getSprite("titleScreenElement.2");
            sprSelectOuter = game.getSprite("titleScreenElement.3");
            sprSelectText = game.getSprite("titleScreenElement.4");
            sprLogoHandLong = game.getSprite("titleScreenElement.5");
            sprLogoHandShort = game.getSprite("titleScreenElement.6");

            posSelectText = new Vector2(Constants.GAME_WORLD_WIDTH * 0.5f, Constants.GAME_WORLD_HEIGHT * 0.634f);
            if (Constants.FULLSCREEN)
            {
                posSelectText = new Vector2(GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Width * 0.5f, GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Height * 0.634f);

            }
            angleHandShort = 135;
            angleHandLong = 350;
            alpha = 1;

            //game.playSong("Audio\\Mp3s\\BulletMusicTitle");

            this.scale = (float)Constants.GAME_WORLD_WIDTH / (float)sprBackground.index.Width;

            player1 = game.playerOneInput;

            //game.player1Score = 0;
            //game.player2Score = 0;

            //battleOptions = new BattleOptions(g, this);
            //game.addEntity(battleOptions);
            //battleOptions.IsVisible = false;
            Sprite startSP=game.getSprite("start");
            Sprite selectLevelSP = game.getSprite("SelectLevel");
            Sprite creativeSP = game.getSprite("CreativeMode");
            Sprite cutSceneSP = game.getSprite("cutScene");
            Sprite exitSP = game.getSprite("Exit");

            Sprite selIcon = game.getSprite("selIcon");

            float spaceValue = 0.45f;
            if (Constants.FULLSCREEN)
                spaceValue = 0.65f;

            Vector2 v1 = new Vector2(posSelectText.X, (posSelectText.Y - (Constants.GAME_WORLD_HEIGHT * 0.01f)));
            Vector2 v2 = new Vector2(posSelectText.X, v1.Y + startSP.index.Height * spaceValue * game.drawingTool.zoomRatio + 20 * game.drawingTool.zoomRatio);
            Vector2 v3 = new Vector2(posSelectText.X, v2.Y + selectLevelSP.index.Height * spaceValue * game.drawingTool.zoomRatio + 20 * game.drawingTool.zoomRatio);

            Vector2 v4 = new Vector2(posSelectText.X, v3.Y + creativeSP.index.Height * spaceValue * game.drawingTool.zoomRatio + 20 * game.drawingTool.zoomRatio);
            Vector2 v5 = new Vector2(posSelectText.X, v4.Y + cutSceneSP.index.Height * spaceValue * game.drawingTool.zoomRatio + 20 * game.drawingTool.zoomRatio);
            if (!Constants.ENABLE_CREATIVE_MODE)
            {
                v4 = new Vector2(posSelectText.X, v2.Y + selectLevelSP.index.Height * spaceValue * game.drawingTool.zoomRatio + 20 * game.drawingTool.zoomRatio);
                v5 = new Vector2(posSelectText.X, v2.Y + selectLevelSP.index.Height * spaceValue * game.drawingTool.zoomRatio + 20 * game.drawingTool.zoomRatio);
            }
            #if XBOX
            v4 = new Vector2(posSelectText.X, v2.Y + selectLevelSP.index.Height * spaceValue * game.drawingTool.zoomRatio + 20 * game.drawingTool.zoomRatio);
            #endif
            start = new Button(g, v1, 0, "start");
            start.setTitleValuee(0);
            selectLevel = new Button(g, v2, 0, "SelectLevel");
            selectLevel.setTitleValuee(1);
            creativeMode = new Button(g, v3, 0, "CreativeMode");
            creativeMode.setTitleValuee(2);
            cutScene = new Button(g, v4, 0, "cutScene");
            cutScene.setTitleValuee(3);
            exit = new Button(g, v5, 0, "Exit");
            exit.setTitleValuee(4);

            game.fadeAlpha = 1f;
            game.drawingTool.resetCamera();
            keyInput = new KeyboardInput();

            posLogoText = new Vector2(Constants.GAME_WORLD_WIDTH * 0.3f, Constants.GAME_WORLD_HEIGHT * (0.301f));
            //LevelEditor le = new LevelEditor(game);
            //le.readFile(-2);
        }