From 5dfe8e88c44e23e8b24c42028b3b2456abaa6cef Mon Sep 17 00:00:00 2001 From: Florian Jung Date: Mon, 24 Aug 2015 22:29:08 +0200 Subject: store cell.movement_angle --- gui.py | 2 +- subscriber.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gui.py b/gui.py index bce2355..5025f26 100644 --- a/gui.py +++ b/gui.py @@ -144,7 +144,7 @@ def generate_virus(spikes, spike_length, radius, global_coords): def draw_cell(cell): cx,cy = world_to_win_pt(cell.pos,c.player.center) try: - mov_ang = cell.movement.angle() + mov_ang = cell.movement_angle p2 = cell.pos + Vec( math.cos(mov_ang + 10*math.pi/180), math.sin(mov_ang + 10*math.pi/180) ) * (cell.size+700) p3 = cell.pos + Vec( math.cos(mov_ang - 10*math.pi/180), math.sin(mov_ang - 10*math.pi/180) ) * (cell.size+700) diff --git a/subscriber.py b/subscriber.py index 3312cbd..01853a8 100644 --- a/subscriber.py +++ b/subscriber.py @@ -100,7 +100,7 @@ class EnhancingSubscriber(DummySubscriber): try: oldpos = cell.poslog[-3-1] cell.movement = (cell.pos - oldpos)/3 + cell.movement_angle = cell.movement.angle() except (AttributeError, IndexError): # no oldpos available - cell.movement = None pass -- cgit v1.2.3