collision fix
This commit is contained in:
@@ -24,6 +24,7 @@ func _process(delta: float) -> void:
|
||||
if delay_dup < 1:
|
||||
delay_dup += delta
|
||||
linear_velocity = direction * SPEED
|
||||
|
||||
|
||||
func split():
|
||||
var packed_use: PackedScene
|
||||
@@ -68,13 +69,22 @@ func _on_body_entered(body: Node) -> void:
|
||||
body.queue_free()
|
||||
GameController.emit_signal("point_gain", type, global_position)
|
||||
split()
|
||||
elif body is Ship and !body.is_inv():
|
||||
|
||||
|
||||
|
||||
func _on_body_exited(body: Node) -> void:
|
||||
if body is Ship:
|
||||
body.is_currently_hit = false
|
||||
|
||||
|
||||
func _on_area_2d_body_entered(body: Node2D) -> void:
|
||||
if body is Ship and !body.is_inv():
|
||||
body.is_currently_hit = true
|
||||
direction = (global_position - body.global_position).normalized()
|
||||
body.velocity += direction * 10
|
||||
#GameController.emit_signal("player_hit")
|
||||
|
||||
|
||||
func _on_body_exited(body: Node) -> void:
|
||||
if body is Ship:
|
||||
body.is_currently_hit = false
|
||||
func _on_area_2d_body_exited(body: Node2D) -> void:
|
||||
if body is Ship :
|
||||
body.is_currently_hit = false
|
||||
|
||||
Reference in New Issue
Block a user