Exemplo n.º 1
0
        private void PrintEntityTree(object sender, EventArgs e)
        {
            Console.WriteLine($"Sprite Tree: \n {EntityHandler.GetEntityTree()}");

            Console.WriteLine("Sprite List:");
            foreach (IEntity s in EntityHandler.EntityList)
            {
                Console.WriteLine($"    ({s})");
            }
        }
Exemplo n.º 2
0
 private void ResetLevel(object sender, EventArgs e)
 {
     FreezeRuntime = true;
     EntityHandler.KillEntites(sender, e);
     Texture2D[] backupPoses = Character.Poses;
     Character       = new Player();
     Character.Poses = backupPoses;
     Level           = new Level();
     Level.SpawnEntities();
     Console.WriteLine(EntityHandler.GetEntityTree());
     FreezeRuntime = false;
 }
Exemplo n.º 3
0
        private void InitializeLevelMode(object sender, EventArgs e)
        {
            InputEvent.DEBUG_ShowHitboxEvent      += ShowHitbox;
            InputEvent.DEBUG_PrintSpriteTreeEvent += PrintEntityTree;
            InputEvent.DEBUG_KillAllSpritesEvent  += EntityHandler.KillEntites;
            InputEvent.DEBUG_ResetLevelEvent      += ResetLevel;
            InputEvent.JumpPressEvent             -= InitializeLevelMode;

            Level = new Level();
            Level.SpawnEntities();
            Console.WriteLine(EntityHandler.GetEntityTree());
            Console.WriteLine($"The main thread is {Thread.CurrentThread.Name}");
            GameMode = GameMode.Level;
        }