projects
/
koperkapel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
af3fcb5
)
Cleanup stale enemy move things
author
Neil
<neil@dip.sun.ac.za>
Sat, 5 Mar 2016 21:28:50 +0000
(23:28 +0200)
committer
Neil
<neil@dip.sun.ac.za>
Sat, 5 Mar 2016 21:29:07 +0000
(23:29 +0200)
koperkapel/gamelib/enemy_roach.py
patch
|
blob
|
history
diff --git
a/koperkapel/gamelib/enemy_roach.py
b/koperkapel/gamelib/enemy_roach.py
index 2645efa8778cca7dd1939465bfa341d1eea58eb0..2e51ef09df745f31f649c9fc5f4483fe91eea5ab 100644
(file)
--- a/
koperkapel/gamelib/enemy_roach.py
+++ b/
koperkapel/gamelib/enemy_roach.py
@@
-2,7
+2,7
@@
import random
-from pgzero.clock import each_tick
+from pgzero.clock import each_tick
, unschedule
from functools import partial
from ..roaches import t32_roaches, WorldRoach
@@
-24,6
+24,9
@@
def get_enemy_roach(level):
def move(roach, dt):
"""Enemy roach move method"""
roach.last_moved += dt
+ if not roach in roach.level.enemies:
+ unschedule(roach.move)
+ return
if roach.last_moved > 0.5:
if not roach.start_pos:
roach.start_pos = roach.game_pos