From 2371258d8eb6da11a7c9c5669c9f499ba44bf02a Mon Sep 17 00:00:00 2001 From: Florian Jung Date: Mon, 31 Aug 2015 21:49:45 +0200 Subject: display how many shots a virus can take (closes #16) --- gui.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'gui.py') diff --git a/gui.py b/gui.py index 2040f32..001fc80 100644 --- a/gui.py +++ b/gui.py @@ -203,6 +203,9 @@ def generate_virus(spikes, spike_length, radius, global_coords): return points def draw_cell(cell): + font_size = 16 + virus_sizes = {100:1, 106:2, 113:3, 119:4, 125:5, 131:6, 136:7} + cx,cy = world_to_win_pt(cell.pos,c.player.center) try: mov_ang = cell.movement_angle @@ -229,6 +232,9 @@ def draw_cell(cell): gfxdraw.filled_polygon(screen, polygon2, color) gfxdraw.aapolygon(screen, polygon2, color) + + draw_text((cx, cy), "%s / 7" % virus_sizes.get(cell.size, "?"), (64,0,0), font_size*2, False, True) + draw_text((cx, cy + radius + 10), str(cell.cid), (0,0,0), font_size, False, True) else: color=(int(cell.color[0]*255), int(cell.color[1]*255), int(cell.color[2]*255)) @@ -242,8 +248,6 @@ def draw_cell(cell): gfxdraw.aacircle(screen, cx, cy, int(radius/2), (255,255,255)) gfxdraw.circle(screen, cx, cy, int(radius/2), (255,255,255)) - font_size = 16 - draw_text((cx, cy + radius + 10), cell.name, (0, 0, 0), font_size, False, True) draw_text((cx, cy + radius + 10 + font_size), str(cell.cid), (0,0,0), font_size, False, True) # surface = draw_text(cell.name, (0, 0, 0), font_size) -- cgit v1.2.3