projects
/
koperkapel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
5d865f0
)
Enemy roaches are orientable
author
Neil
<neil@dip.sun.ac.za>
Sat, 5 Mar 2016 22:07:46 +0000
(
00:07
+0200)
committer
Neil
<neil@dip.sun.ac.za>
Sat, 5 Mar 2016 22:08:49 +0000
(
00:08
+0200)
koperkapel/gamelib/enemy_roach.py
patch
|
blob
|
history
diff --git
a/koperkapel/gamelib/enemy_roach.py
b/koperkapel/gamelib/enemy_roach.py
index 90695b3916f99e2594fd8e1833a251046b9404fa..2a8438241f3bdc8ac3fa0380a57b28bc1b6e6834 100644
(file)
--- a/
koperkapel/gamelib/enemy_roach.py
+++ b/
koperkapel/gamelib/enemy_roach.py
@@
-13,6
+13,7
@@
def get_enemy_roach(level):
roach.anchor = (-16, -16) # this should center them on the tile
roach.game_pos = (0, 0)
roach.health = 5
roach.anchor = (-16, -16) # this should center them on the tile
roach.game_pos = (0, 0)
roach.health = 5
+ roach.angle = 0
roach.level = level
roach.move = partial(move, roach)
roach.last_moved = 0
roach.level = level
roach.move = partial(move, roach)
roach.last_moved = 0
@@
-45,4
+46,12
@@
def move(roach, dt):
if enemy and enemy is not roach:
continue
roach.game_pos = (roach.game_pos[0] + dx, roach.game_pos[1] + dy)
if enemy and enemy is not roach:
continue
roach.game_pos = (roach.game_pos[0] + dx, roach.game_pos[1] + dy)
+ if dy == 1:
+ roach.angle = 180
+ elif dy == -1:
+ roach.angle = 0
+ elif dx == 1:
+ roach.angle = 270
+ else:
+ roach.angle = 90
break
break