public void Draw(GameCanvas canvas) { foreach (Item it in Items) { it.Draw(canvas); } }
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)); }
public void Draw(GameCanvas canvas) { CurLevel.Draw(canvas); }
public void Draw(GameCanvas canvas) { foreach (GameUnit unit in Units) { unit.Draw(canvas); } if (Player != null) { Player.Draw(canvas); } }
public GameEngine() { canvas = new GameCanvas(this); factory = new ContentFactory(new ContentManager(Services)); camera = new Camera(canvas.Width, canvas.Height); }
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)); }