Ejemplo n.º 1
0
        private static void checkCodesInPlayerCenter(GameObject player)
        {
            Vector2 collisionCenter = player.GetCollisionCenter(player.PublicCollisionRectangle);

            foreach (string codePart in TileMap.GetCellCodes(TileMap.GetCellByPixel(collisionCenter)))
            {
                string[] codeArray = codePart.Split('_');
                switch (codeArray[0])
                {
                case "TRANSITION":
                    if (LevelManager.CurrentMap.Properties["Mode"] == "RPG")
                    {
                        StateManager.GameState = GameStates.RPG;
                    }
                    else if (LevelManager.CurrentMap.Properties["Mode"] == "Platform")
                    {
                        StateManager.GameState = GameStates.Platform;
                    }
                    IngameManager.Activate();
                    LevelManager.LoadLevel(codeArray[1]);
                    break;

                case "PIPE":
                    if (InputMapper.STRICTDOWN)
                    {
                        StateManager.GameState = GameStates.RPG;
                        RPGManager.Activate();
                    }
                    break;

                case "DIALOG":
                    if (InputMapper.STRICTACTION)
                    {
                        DialogManager.PlayDialog(DialogDictionaryProvider.GetDummyDialog(), "Test1");
                        StateManager.DialogState = DialogueStates.Active;
                    }
                    break;
                }
            }
        }
Ejemplo n.º 2
0
        public static void Update()
        {
            switch (GameState)
            {
            case GameStates.Title:
                TitleScreenManager.Update();
                break;

            case GameStates.Menu:
                MenuManager.Update();
                break;

            case GameStates.Platform:
            case GameStates.RPG:
                IngameManager.Update();
                break;
            }

            if (GamePaused)
            {
                MenuManager.Update();
            }
        }