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
|
||||
|
@ -61,8 +62,8 @@ func _physics_process(delta):
|
|||
# set line point to point of collision
|
||||
var hit_x = shoot_line.to_local(hit_position).x
|
||||
shoot_line.points[1].x = hit_x
|
||||
# shoot_line.visible = true
|
||||
# get_tree().create_timer(0.05, false).connect("timeout", shoot_line, "set_visible", [false], CONNECT_DEFERRED)
|
||||
# shoot_line.visible = true
|
||||
# get_tree().create_timer(0.05, false).connect("timeout", shoot_line, "set_visible", [false], CONNECT_DEFERRED)
|
||||
# move and play sparks
|
||||
sparks.global_position = hit_position
|
||||
sparks.emitting = true
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue