Ejemplo n.º 1
0
 public void AddStuff(DataBase DBase, GameLoop loop)
 {
     level           = new Level(DBase, inventory);
     inventory.level = level;
     level.UpdatePlayerInfo(this);
     this.loop = loop;
 }
Ejemplo n.º 2
0
 public void Draw(GameLoop gl)
 {
     gl.window.Draw(rectangle);
     if (text != null)
     {
         gl.window.Draw(text);
     }
 }
Ejemplo n.º 3
0
        public static void Message(GameLoop gameLoop, object message, float y)
        {
            if (consoleFont == null)
            {
                return;
            }

            Text text = CreateText(message, y);

            gameLoop.window.Draw(text);
        }
Ejemplo n.º 4
0
        public static void Message(GameLoop gameLoop, object message)
        {
            if (consoleFont == null)
            {
                return;
            }
            fontColor = Color.Black;
            Text text = CreateText(message, 0);

            gameLoop.window.Draw(text);
        }
Ejemplo n.º 5
0
        public static void Message(GameLoop gameLoop, object message, Color color)
        {
            if (consoleFont == null)
            {
                return;
            }

            Text text = CreateText(message, 0);

            fontColor = color;

            gameLoop.window.Draw(text);
        }
Ejemplo n.º 6
0
 public void Draw(GameLoop gameLoop)
 {
     if (player.currentState == Player.state.walk)
     {
         legs.Draw(gameLoop);
         body.Draw(gameLoop);
         sword.Draw(gameLoop);
         head.Draw(gameLoop);
     }
     else if (player.currentState == Player.state.fight)
     {
         btnAttack.Draw(gameLoop);
         btnDefend.Draw(gameLoop);
         btnItem.Draw(gameLoop);
     }
 }
Ejemplo n.º 7
0
 private void UsePlayerIcons(GameLoop loop)
 {
     if (head.IsButtonHold(loop, Mouse.Button.Right) && player.inventory.head != null)
     {
         player.inventory.TakeOff(Defence.type.head);
     }
     if (legs.IsButtonHold(loop, Mouse.Button.Right) && player.inventory.legs != null)
     {
         player.inventory.TakeOff(Defence.type.legs);
     }
     if (body.IsButtonHold(loop, Mouse.Button.Right) && player.inventory.body != null)
     {
         player.inventory.TakeOff(Defence.type.body);
     }
     if (sword.IsButtonHold(loop, Mouse.Button.Right) && player.inventory.weapon != null)
     {
         player.inventory.TakeOffWeapon();
     }
     UpdateIcons();
 }
Ejemplo n.º 8
0
 public void UseInventory(GameLoop loop)
 {
     foreach (InventoryButton btn in items)
     {
         if (btn.IsButtonHold(loop))
         {
             int i = items.IndexOf(btn);
             if (btn.obj != null)
             {
                 player.inventory.TakeOn(btn.obj);
             }
             else if (btn.objWeapon != null)
             {
                 player.inventory.TakeOn(btn.objWeapon);
             }
             items.Remove(btn);
             break;
         }
     }
     UpdatePlayerInventory();
     UsePlayerIcons(loop);
     UpdateIcons();
 }
Ejemplo n.º 9
0
 public bool IsButtonHold(GameLoop loop, Mouse.Button btn)
 => rectangle.GetGlobalBounds().Contains(Mouse.GetPosition(loop.window).X, Mouse.GetPosition(loop.window).Y) && Mouse.IsButtonPressed(btn);