diff options
author | Florian Jung <flo@windfisch.org> | 2015-08-24 18:52:36 +0200 |
---|---|---|
committer | Florian Jung <flo@windfisch.org> | 2015-08-24 18:52:36 +0200 |
commit | 8a44a7c1f11211d56d54c185dc8fdc90e35f221b (patch) | |
tree | 072eaa27b648377bdadd308ab7774ee27ad6ddeb /subscriber.py | |
parent | c2e13a67d969f1208a8b8c127c94a9841c7048d9 (diff) |
draw the direction where ejected mass would fly
Diffstat (limited to 'subscriber.py')
-rw-r--r-- | subscriber.py | 10 |
1 files changed, 10 insertions, 0 deletions
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 |