コード例 #1
0
ファイル: Lobby.cs プロジェクト: Wargamer3/Project-Eternity
        public override void Update(GameTime gameTime)
        {
            if (OnlineGameClient != null)
            {
                OnlineGameClient.ExecuteDelayedScripts();
                OnlineCommunicationClient.ExecuteDelayedScripts();

                ChatHelper.UpdateChat(gameTime, OnlineCommunicationClient.Chat, ChatInput);
            }

            if (FMODSystem.sndActiveBGM != sndBGM)
            {
                sndBGM.PlayAsBGM();
            }

            Rectangle LicenseBox = new Rectangle(572, 16, 24, 24);

            if (LicenseBox.Intersects(new Rectangle(MouseHelper.MouseStateCurrent.X, MouseHelper.MouseStateCurrent.Y, 1, 1)))
            {
                if (MouseHelper.InputLeftButtonPressed())
                {
                    if (RoomType == RoomInformations.RoomTypeMission)
                    {
                        RoomType = RoomInformations.RoomTypeBattle;
                    }
                    else
                    {
                        RoomType = RoomInformations.RoomTypeMission;
                    }
                }
            }

            UpdateRooms();
            UpdatePlayers();

            foreach (IUIElement ActiveButton in ArrayMenuButton)
            {
                ActiveButton.Update(gameTime);
            }
        }
コード例 #2
0
        public override void Update(GameTime gameTime)
        {
            if (OnlineGameClient != null)
            {
                OnlineGameClient.ExecuteDelayedScripts();
            }

            if (OnlineCommunicationClient != null)
            {
                OnlineCommunicationClient.ExecuteDelayedScripts();
                ChatHelper.UpdateChat(gameTime, OnlineCommunicationClient.Chat, ChatInput);
            }

            if (FMODSystem.sndActiveBGM != sndBGM)
            {
                sndBGM.PlayAsBGM();
            }

            foreach (InteractiveButton ActiveButton in ArrayMenuButton)
            {
                ActiveButton.Update(gameTime);
            }

            MissionScrollbar.Update(gameTime);

            foreach (Player ActiveRobot in Room.ListRoomPlayer)
            {
                if (ActiveRobot.CharacterPreview != null)
                {
                    ActiveRobot.CharacterPreview.Update(gameTime);
                    ActiveRobot.CharacterPreview.UpdateAllWeaponsAngle(new Vector2(5, 0));
                }
            }

            if (KeyboardHelper.KeyPressed(Microsoft.Xna.Framework.Input.Keys.F1))
            {
                Player NewPlayer = new Player("", "", Player.PlayerTypes.Player, 0);
                Room.AddLocalPlayer(NewPlayer);
                NewPlayer.GameplayType = GameplayTypes.Controller1;
            }
            else if (KeyboardHelper.KeyPressed(Microsoft.Xna.Framework.Input.Keys.F2))
            {
                Player NewPlayer = new Player("", "", Player.PlayerTypes.Player, 0);
                Room.AddLocalPlayer(NewPlayer);
                NewPlayer.GameplayType = GameplayTypes.Controller2;
            }
            else if (KeyboardHelper.KeyPressed(Microsoft.Xna.Framework.Input.Keys.F3))
            {
                Player NewPlayer = new Player("", "", Player.PlayerTypes.Player, 0);
                Room.AddLocalPlayer(NewPlayer);
                NewPlayer.GameplayType = GameplayTypes.Controller3;
            }
            else if (KeyboardHelper.KeyPressed(Microsoft.Xna.Framework.Input.Keys.F4))
            {
                Player NewPlayer = new Player("", "", Player.PlayerTypes.Player, 0);
                Room.AddLocalPlayer(NewPlayer);
                NewPlayer.GameplayType = GameplayTypes.Controller4;
            }

            if (MouseHelper.InputLeftButtonPressed() && IsHost)
            {
                for (int M = MissionInfoStartIndex, i = 0; M < ListMissionInfo.Count && i < 4; ++M, ++i)
                {
                    Rectangle QuestButtonCollisionBox = new Rectangle(405 - (int)QuestButton.Origin.X,
                                                                      140 - (int)QuestButton.Origin.Y + i * 64,
                                                                      QuestButton.SpriteWidth,
                                                                      QuestButton.SpriteHeight);

                    if (QuestButtonCollisionBox.Contains(MouseHelper.MouseStateCurrent.X, MouseHelper.MouseStateCurrent.Y))
                    {
                        UpdateSelectedMission(ListMissionInfo[M]);
                        break;
                    }
                }
            }
        }
コード例 #3
0
        public override void Update(GameTime gameTime)
        {
            if (OnlineGameClient != null)
            {
                OnlineGameClient.ExecuteDelayedScripts();
            }

            if (OnlineCommunicationClient != null)
            {
                OnlineCommunicationClient.ExecuteDelayedScripts();
            }

            if (FMODSystem.sndActiveBGM != sndBGM)
            {
                sndBGM.PlayAsBGM();
            }

            foreach (InteractiveButton ActiveButton in ArrayMenuButton)
            {
                ActiveButton.Update(gameTime);
            }

            if (OnlineCommunicationClient != null)
            {
                ChatHelper.UpdateChat(gameTime, OnlineCommunicationClient.Chat, ChatInput);
            }

            foreach (Player ActiveRobot in Room.ListRoomPlayer)
            {
                if (ActiveRobot.CharacterPreview != null)
                {
                    ActiveRobot.CharacterPreview.Update(gameTime);
                    ActiveRobot.CharacterPreview.UpdateAllWeaponsAngle(new Vector2(5, 0));
                }
            }

            if (KeyboardHelper.KeyPressed(Microsoft.Xna.Framework.Input.Keys.F1))
            {
                Player NewPlayer = new Player("", "", Player.PlayerTypes.Player, 0);
                Room.AddLocalPlayer(NewPlayer);
                NewPlayer.GameplayType = GameplayTypes.Controller1;
            }
            else if (KeyboardHelper.KeyPressed(Microsoft.Xna.Framework.Input.Keys.F2))
            {
                Player NewPlayer = new Player("", "", Player.PlayerTypes.Player, 0);
                Room.AddLocalPlayer(NewPlayer);
                NewPlayer.GameplayType = GameplayTypes.Controller2;
            }
            else if (KeyboardHelper.KeyPressed(Microsoft.Xna.Framework.Input.Keys.F3))
            {
                Player NewPlayer = new Player("", "", Player.PlayerTypes.Player, 0);
                Room.AddLocalPlayer(NewPlayer);
                NewPlayer.GameplayType = GameplayTypes.Controller3;
            }
            else if (KeyboardHelper.KeyPressed(Microsoft.Xna.Framework.Input.Keys.F4))
            {
                Player NewPlayer = new Player("", "", Player.PlayerTypes.Player, 0);
                Room.AddLocalPlayer(NewPlayer);
                NewPlayer.GameplayType = GameplayTypes.Controller4;
            }
        }