Ejemplo n.º 1
0
 public void Draw(GameCanvas canvas)
 {
     Color color = Color.White;
     switch (Type)
     {
         case ItemType.PLASMID:
             color = Color.Blue;
             break;
         case ItemType.HEALTH:
             color = Color.White;
             break;
         case ItemType.ATTACK:
             color = Color.Yellow;
             break;
     }
     canvas.DrawSprite(Texture, color,
         new Rectangle((int)Position.X - ITEM_SIZE/2, (int)Position.Y - ITEM_SIZE/2, ITEM_SIZE, ITEM_SIZE),
         new Rectangle(0, 0, Texture.Width, Texture.Height));
 }
Ejemplo n.º 2
0
        public void Draw(GameCanvas canvas)
        {
            // test
            Texture2D texture = Vel.X > 0.5 ? Texture_R : Texture_L;

            Color color = Color.White;
            if (Immune)
            {
                color = new Color(50, (int)Health + 150, (int)Health + 150, 250);
            }
            else
            {
                color = new Color(250, (int)Health + 150, (int)Health + 150, 250);
            }
            if (!Exists)
            {
                color = Color.Gray;
            }

            canvas.DrawSprite(texture, color,
                new Rectangle((int)(Position.X - Size/2), (int)(Position.Y - Size/2), Size, Size),
                new Rectangle(0, 0, texture.Width, texture.Height));
            canvas.DrawText("T", Color.Yellow, NextMove - new Vector2(20, 20));
        }