123456789101112131415161718192021222324 |
- extends Area2D
- func _process(delta):
- var bodies: Array[Node2D] = get_overlapping_bodies()
- for body in bodies:
- print(body.get_name(), " is overlapping with me")
- body.paint()
- force_body_scan()
- func _unhandled_input(event: InputEvent) -> void:
- if event is InputEventMouseMotion:
- var mouseMotion = event as InputEventMouseMotion
- position = mouseMotion.position
- func force_body_scan() -> void:
- set_position(get_position())
- func _on_body_entered(body: Node2D) -> void:
- print(body.get_name(), " entered in my area")
- body.paint()
|