From 8a44a7c1f11211d56d54c185dc8fdc90e35f221b Mon Sep 17 00:00:00 2001 From: Florian Jung Date: Mon, 24 Aug 2015 18:52:36 +0200 Subject: draw the direction where ejected mass would fly --- subscriber.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'subscriber.py') diff --git a/subscriber.py b/subscriber.py index 1dcccc6..feddf04 100644 --- a/subscriber.py +++ b/subscriber.py @@ -95,4 +95,14 @@ class EnhancingSubscriber(DummySubscriber): self.history[cid].stale = False self.history = {k: v for k, v in self.history.items() if v.stale == False} + + for cid in self.c.world.cells: + cell = self.c.world.cells[cid] + try: + oldpos = cell.poslog[-3-1] + cell.movement = (cell.pos - oldpos)/3 + except (AttributeError, IndexError): + # no oldpos available + cell.movement = None + pass -- cgit v1.2.3