projects
/
koperkapel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Check bullets and enemies are on the same level
[koperkapel.git]
/
koperkapel
/
gamelib
/
enemy_roach.py
diff --git
a/koperkapel/gamelib/enemy_roach.py
b/koperkapel/gamelib/enemy_roach.py
index 2201c586f389e51193bc9c6851c9f5ea6b2a116e..b09c3aa0f98af86c03169af0824f05935ddfc259 100644
(file)
--- a/
koperkapel/gamelib/enemy_roach.py
+++ b/
koperkapel/gamelib/enemy_roach.py
@@
-15,6
+15,7
@@
def get_enemy_roach(level):
roach.health = 5
roach.angle = 0
roach.level = level
roach.health = 5
roach.angle = 0
roach.level = level
+ roach.level_layer = 'floor' # always the case for now
roach.move = partial(move, roach)
roach.last_moved = 0
roach.last_attacked= 0
roach.move = partial(move, roach)
roach.last_moved = 0
roach.last_attacked= 0
@@
-27,7
+28,7
@@
def get_enemy_roach(level):
def attack(roach, player_pos, player_layer, dt):
"""Attack the player if close enough"""
roach.last_attacked += dt
def attack(roach, player_pos, player_layer, dt):
"""Attack the player if close enough"""
roach.last_attacked += dt
- if roach.last_attacked > 0.
3
:
+ if roach.last_attacked > 0.
6
:
roach.last_attacked = 0
if player_layer != 'floor':
return None
roach.last_attacked = 0
if player_layer != 'floor':
return None