Пример #1
0
 public GamePlayController(ScreenManager screen, Map selectedMap)
     : base(screen)
 {
     this.players = new Dictionary<int, PlayerStatsController>();
     this.characterControllers = new List<CharacterController>();
     this.map = new MapController(screen, selectedMap);
 }
Пример #2
0
 public MapController(ScreenManager screen, Map currentMap)
     : base(screen)
 {
     this.boxes = new List<Body>();
     this.Model = currentMap;
 }
Пример #3
0
        private void OnCursorClick(int playerIndex, object targetData, CursorModel cursor, bool selectKey)
        {
            if (cursor.TargetCategory == Category.Cat5)
            {
                if (targetData.GetType() == typeof(string))
                {
                    string s = targetData.ToString();
                    if (s == "options")
                    {
                        Screen.popupMenuController.State = PopupState.Options;
                    }
                    else if (s == "help")
                    {
                        Screen.popupMenuController.State = PopupState.Help;
                    }
                }
                else
                {
                    switch (CurrentState)
                    {
                        case GameState.CharacterMenu:
                            if (selectKey && cursor.Enabled)
                            {
                                GamePadControllers[playerIndex].PlayerModel.SelectedCharacter = characterModels[(int)targetData];
                                GamePadControllers[playerIndex].PlayerModel.CharacterIndex = (int)targetData;
                                Screen.cursorsController.DisableCursor(playerIndex);

                                Screen.soundController.PlaySound(characterModels[(int)targetData].sound_selected);
                            }
                            else if (!selectKey)
                            {
                                if(GamePadControllers[playerIndex].PlayerModel.SelectedCharacter != null)
                                    hoverCharacter(playerIndex, characterModels.IndexOf(GamePadControllers[playerIndex].PlayerModel.SelectedCharacter));

                                GamePadControllers[playerIndex].PlayerModel.SelectedCharacter = null;
                                Screen.cursorsController.EnableCursor(playerIndex);
                            }
                            break;
                        case GameState.MapsMenu:
                            if (selectKey)
                            {
                                selectedMap = mapModels[(int)targetData];
                                Screen.cursorsController.EnableCursors = false;
                                AddView(continueText);
                            }
                            else
                            {
                                RemoveView(continueText);
                                Screen.cursorsController.EnableCursors = true;
                            }

                            break;
                    }
                }
            }
        }