예제 #1
0
        //man hat 60 sekunden um 10 Items zu sammeln, schafft man es gewinnt man, schafft man es nicht so verliert man
        public override void initialize()
        {
            base.initialize();

            //anzahl der eingesammelten Items
            numberItemsCollected = new Text[playerList.Count];
            int i = 0;
            foreach (Player p in playerList)
            {
                numberItemsCollected[i] = new Text("Items Collected: 0/10", new Vector2(0, 0));
                numberItemsCollected[i].setIndividualScale(scale);//mehr geht nicht wegen minimap im multiplayer
                numberItemsCollected[i].setPosition(new Vector2(p.getViewport().X + p.getViewport().Width / 2 - numberItemsCollected[i].getWidth() / 2,p.getViewport().Y + p.getViewport().Height - numberItemsCollected[i].getHeight()));
                i++;
            }

            if (playerList.Count == 1)
            {//singleplayer ligic
                clock = new Clock(new Vector2(0, 0));
                clock.setIndividualScale(scale);
                clock.setPosition(new Vector2(playerList.First().getViewport().Width / 2 - clock.getWidth() / 2, playerList.First().getViewport().Height - clock.getHeight() - numberItemsCollected[0].getHeight()));

                clock.start();
            }

            currentInGameState = EInGameState.RushHour;
        }
예제 #2
0
파일: Clock.cs 프로젝트: tobeneck/WitchMaze
 public Clock(Vector2 _position)
 {
     position = _position;
     minutes = new Text("00", position);
     doppelpunkt = new Text(" : ", minutes.getPosition() + new Vector2(minutes.getWidth(), 0));
     seconds = new Text("00", doppelpunkt.getPosition() + new Vector2(doppelpunkt.getWidth(), 0));
     elapsedTime = 0f;
 }
예제 #3
0
파일: Won.cs 프로젝트: tobeneck/WitchMaze
        public Won(PlayerStuff.Player.EPlayerViewportPosition playerIndex, bool won)
        {
            infoText = new Text("03", new Vector2(0, 0));
            infoText.setIndividualScale(2);
            infoText.setPosition(new Vector2(Settings.getResolutionX() / 2 - infoText.getWidth() / 2, Settings.getResolutionY() - infoText.getHeight()));
            elapsedTime = 0;

            switch (playerIndex)
            {

                case PlayerStuff.Player.EPlayerViewportPosition.fullscreen:
                    if(won)
                       {
                           infoText.setColor(Color.Black);
                         background = new Icon(new Microsoft.Xna.Framework.Vector2(0, 0), "Textures/WinScreens/youWin");
                       }
                    else
                    {
                        infoText.setColor(Color.White);
                        background = new Icon(new Microsoft.Xna.Framework.Vector2(0, 0), "Textures/WinScreens/youLose");
                    }
                    break;
                case PlayerStuff.Player.EPlayerViewportPosition.left:
                    infoText.setColor(Color.White);
                    background = new Icon(new Microsoft.Xna.Framework.Vector2(0, 0), "Textures/WinScreens/player1Win");
                    break;
                case PlayerStuff.Player.EPlayerViewportPosition.right:
                    infoText.setColor(Color.White);
                    background = new Icon(new Microsoft.Xna.Framework.Vector2(0, 0), "Textures/WinScreens/player2Win");
                    break;
                case PlayerStuff.Player.EPlayerViewportPosition.topLeft:
                    infoText.setColor(Color.White);
                    background = new Icon(new Microsoft.Xna.Framework.Vector2(0, 0), "Textures/WinScreens/player1Win");
                    break;
                case PlayerStuff.Player.EPlayerViewportPosition.botLeft:
                    infoText.setColor(Color.White);
                    background = new Icon(new Microsoft.Xna.Framework.Vector2(0, 0), "Textures/WinScreens/player2Win");
                    break;
                case PlayerStuff.Player.EPlayerViewportPosition.topRight:
                    infoText.setColor(Color.White);
                    background = new Icon(new Microsoft.Xna.Framework.Vector2(0, 0), "Textures/WinScreens/player3Win");
                    break;
                case PlayerStuff.Player.EPlayerViewportPosition.botRight:
                    infoText.setColor(Color.White);
                    background = new Icon(new Microsoft.Xna.Framework.Vector2(0, 0), "Textures/WinScreens/player4Win");
                    break;
            }
        }
예제 #4
0
        public override void loadContent()
        {
            if (Game1.getGraphics() != null)
            {
                distY *= Settings.getInterfaceScale();
                offset *= Settings.getInterfaceScale();
                gameModeIcon = new Icon(gameModeIconPosition, "Textures/CharacterSelection/GameMode");
                rushHour = new Icon(new Vector2(1200 * Settings.getInterfaceScale(), 45 * Settings.getInterfaceScale()), "Textures/CharacterSelection/RushHourExplanation");
                needForIngredients = new Icon(new Vector2(1200 * Settings.getInterfaceScale(), 45 * Settings.getInterfaceScale()), "Textures/CharacterSelection/NeedForIngredientsExplanation");
                //spaceNote = new Icon(new Vector2(1090 * Settings.getInterfaceScale(), 900 * Settings.getInterfaceScale()), "Textures/CharacterSelection/SpaceHinweis");
                escapeNote = new Icon(new Vector2(1080 * Settings.getInterfaceScale(), 950 * Settings.getInterfaceScale()), "Textures/CharacterSelection/escapeNote");
                keyboard1 = new Icon(new Vector2(1005 * Settings.getInterfaceScale(), 300 * Settings.getInterfaceScale()), "Textures/CharacterSelection/Keyboard1");
                keyboard2 = new Icon(new Vector2(1005 * Settings.getInterfaceScale(), 510 * Settings.getInterfaceScale()), "Textures/CharacterSelection/Keyboard2");
                gamepad = new Icon(new Vector2(1005 * Settings.getInterfaceScale(), 725 * Settings.getInterfaceScale()), "Textures/CharacterSelection/Gamepad1");
                player1Icon = new Button(new Vector2(20, (gameModeIcon.getPosition().Y + gameModeIcon.getHeight()) + distY), "Textures/CharacterSelection/Player1NotSelected", "Textures/CharacterSelection/Player1Selected");
                player2Icon = new Button(new Vector2(20, (player1Icon.getPosition().Y + player1Icon.getHeight()) + distY), "Textures/CharacterSelection/Player2NotSelected", "Textures/CharacterSelection/Player2Selected");
                player3Icon = new Button(new Vector2(20, (player2Icon.getPosition().Y + player2Icon.getHeight()) + distY), "Textures/CharacterSelection/Player3NotSelected", "Textures/CharacterSelection/Player3Selected");
                player4Icon = new Button(new Vector2(20, (player3Icon.getPosition().Y + player3Icon.getHeight()) + distY), "Textures/CharacterSelection/Player4NotSelected", "Textures/CharacterSelection/Player4Selected");

                String[] gameModes = {"Textures/CharacterSelection/NeedForIngredientsNotSelected", "Textures/CharacterSelection/RushHourNotSelected"};//GameModeIdeen: RushHour, Need for Ingrediance, SpeedRun, NeedForItems
                //0 = test;
                //1 = rushHour;
                GameModeSelected = new LeftRightSwitch(new Vector2(gameModeIconPosition.X + gameModeIcon.getWidth() + offset, gameModeIconPosition.Y), gameModes);
                GameModeSelected.setSelected();
                String[] playerControlls = { "Textures/CharacterSelection/Join",
                                               "Textures/CharacterSelection/Keyboard","Textures/CharacterSelection/KeyboardNumPad",
                                               "Textures/CharacterSelection/GamepadNr1", "Textures/CharacterSelection/GamepadNr2", "Textures/CharacterSelection/GamepadNr3", "Textures/CharacterSelection/GamepadNr4"  };
                // 1 := join
                // 2 := Keyboard
                // 3 := Gamepad
                player1ControllsLRS = new LeftRightSwitch(new Vector2(player1Icon.getPosition().X + player1Icon.getWidth() + offset, player1Icon.getPosition().Y), playerControlls);
                player2ControllsLRS = new LeftRightSwitch(new Vector2(player2Icon.getPosition().X + player2Icon.getWidth() + offset, player2Icon.getPosition().Y), playerControlls);
                player3ControllsLRS = new LeftRightSwitch(new Vector2(player3Icon.getPosition().X + player3Icon.getWidth() + offset, player3Icon.getPosition().Y), playerControlls);
                player4ControllsLRS = new LeftRightSwitch(new Vector2(player4Icon.getPosition().X + player4Icon.getWidth() + offset, player4Icon.getPosition().Y), playerControlls);

                infoText = new Text("Game starts in 03!", new Vector2(0, 0));
                infoText.setIndividualScale(3);
                infoText.setPosition(new Vector2(Settings.getResolutionX() / 2 - infoText.getWidth() / 2, Settings.getResolutionY() / 2 - infoText.getHeight() / 2));
                infoText.setColor(Color.White);
            }
        }