cops only shoot characters on the same screen as them (fixes issue #79)
This commit is contained in:
parent
3e51a5062f
commit
8ac962d855
1 changed files with 24 additions and 23 deletions
|
@ -44,6 +44,7 @@ func _physics_process(delta):
|
|||
# check for player in raycast
|
||||
var collider = shoot_cast.get_collider()
|
||||
if collider != null && (collider.is_in_group("player") or collider.is_in_group("msx")):
|
||||
if Game.get_sector(global_position) == Game.get_sector(collider.global_position):
|
||||
# kill player and enter shooting state temporarily
|
||||
collider.get_parent().die()
|
||||
# play sound
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue