18 lines
339 B
GDScript
18 lines
339 B
GDScript
extends Node2D
|
|
|
|
|
|
var _player: Player = null
|
|
|
|
|
|
func _physics_process(delta: float) -> void:
|
|
_player.state_chart.send_event(&"touched_ice")
|
|
|
|
|
|
func _on_player_detector_body_entered(body: Node2D) -> void:
|
|
if body is Player:
|
|
_player = body
|
|
|
|
|
|
func _on_player_detector_body_exited(body: Node2D) -> void:
|
|
if body == _player:
|
|
_player = null
|