Draw dragons in different colors than players
This commit is contained in:
@@ -80,18 +80,18 @@ namespace WorldOfPeacecraft
|
|||||||
IEnumerable<IPositionable> dragons = Backend.GetDragons ();
|
IEnumerable<IPositionable> dragons = Backend.GetDragons ();
|
||||||
IEnumerable<IPositionable> players = Backend.GetPlayers ();
|
IEnumerable<IPositionable> players = Backend.GetPlayers ();
|
||||||
foreach (IPositionable dragon in dragons) {
|
foreach (IPositionable dragon in dragons) {
|
||||||
PaintEntity (g, dragon);
|
PaintEntity (g, dragon, Color.Red);
|
||||||
}
|
}
|
||||||
foreach (IPositionable player in players) {
|
foreach (IPositionable player in players) {
|
||||||
PaintEntity (g, player);
|
PaintEntity (g, player, Color.LightGreen);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void PaintEntity (Graphics g, IPositionable entity)
|
public void PaintEntity (Graphics g, IPositionable entity, Color color)
|
||||||
{
|
{
|
||||||
int x = entity.GetX () * TileSize + TileSize / 2 - EntitySize / 2;
|
int x = entity.GetX () * TileSize + TileSize / 2 - EntitySize / 2;
|
||||||
int y = entity.GetY () * TileSize + TileSize / 2 - EntitySize / 2;
|
int y = entity.GetY () * TileSize + TileSize / 2 - EntitySize / 2;
|
||||||
g.FillRectangle (new SolidBrush (Color.Red), x, y, EntitySize, EntitySize);
|
g.FillRectangle (new SolidBrush (color), x, y, EntitySize, EntitySize);
|
||||||
g.DrawRectangle (new Pen( new SolidBrush (Color.Black)), x, y, EntitySize, EntitySize);
|
g.DrawRectangle (new Pen( new SolidBrush (Color.Black)), x, y, EntitySize, EntitySize);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user