summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Jung <flo@windfisch.org>2015-08-31 21:49:45 +0200
committerFlorian Jung <flo@windfisch.org>2015-08-31 21:49:45 +0200
commit2371258d8eb6da11a7c9c5669c9f499ba44bf02a (patch)
treea31e468a30d121c899b0b3888e0aee6703a432a7
parent074b6cc570cdf897a2f9974617b53267faff6a13 (diff)
display how many shots a virus can take (closes #16)
-rw-r--r--gui.py8
1 files changed, 6 insertions, 2 deletions
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)