Exemple #1
0
        private void TestingActions(object sender, TestingDeviceEventArgs e)
        {
            switch (e.Action)
            {
            case TestingDeviceActions.ToggleGodMode:
                if (TestingDevice.godModeIsEnabled)
                {
                    EnableGodMode();
                }
                else
                {
                    DisableGodMode();
                }
                break;

            case TestingDeviceActions.ToggleCollision:
                break;

            case TestingDeviceActions.AddItem:

                UpdateInventory(e.Param as Entity);

                if (e.Param is Item)
                {
                    GameManager.WriteSubtext(0, "1 " + ((Item)e.Param).Name + " has been added.");
                }

                UpdateInventory(null);

                GameManager.Legend.DrawInventory();
                break;

            case TestingDeviceActions.WinGame:
                break;

            case TestingDeviceActions.KillAllEnemies:
                break;

            case TestingDeviceActions.ClearAllItems:
                break;

            case TestingDeviceActions.ClearAllEntities:
                break;

            default:
                break;
            }
        }
Exemple #2
0
        static void TestingActions(object sender, TestingDeviceEventArgs e)
        {
            switch (e.Action)
            {
            case TestingDeviceActions.ToggleGodMode:
                if (TestingDevice.godModeIsEnabled)
                {
                    WriteSubtext(0, "god mode is enabled.");
                }
                else
                {
                    WriteSubtext(0, "god mode is disabled.");
                }
                break;

            case TestingDeviceActions.ToggleCollision:
                if (TestingDevice.collisionIsEnabled)
                {
                    WriteSubtext(0, "collision is enabled.");
                }
                else
                {
                    WriteSubtext(0, "collision is disabled.");
                }
                break;

            case TestingDeviceActions.AddItem:
                break;

            case TestingDeviceActions.WinGame:
                hero.Health = 10;
                mapCounter  = 10;
                break;

            case TestingDeviceActions.LoadNextLevel:
                GenerateNextLevel();
                break;

            case TestingDeviceActions.KillAllEnemies:
                Entities.RemoveAll(T => T is Enemy);
                ShowNewScreen();
                WriteSubtext(0, "removed all enemies.");
                break;

            case TestingDeviceActions.ClearAllItems:
                Entities.RemoveAll(T => T is Item);
                ShowNewScreen();
                WriteSubtext(0, "removed all items.");
                break;

            case TestingDeviceActions.ClearAllEntities:
                Entities.RemoveAll(T => T is Enemy);
                Entities.RemoveAll(T => T is Item);
                ShowNewScreen();
                WriteSubtext(0, "removed all entities.");
                break;

            default:
                break;
            }
        }