diff --git a/scenes/game/cursor.gd b/scenes/game/cursor.gd new file mode 100644 index 0000000..79bcc35 --- /dev/null +++ b/scenes/game/cursor.gd @@ -0,0 +1,11 @@ +extends Node2D +class_name Cursor + +## A [Node2D] syncing its position with the mouse on each physics timestep. + + +@onready var game := MainGame.get_ancestor(self) + + +func _physics_process(_delta: float) -> void: + global_position = game.camera.get_global_mouse_position() diff --git a/scenes/game/cursor.tscn b/scenes/game/cursor.tscn new file mode 100644 index 0000000..e31c98e --- /dev/null +++ b/scenes/game/cursor.tscn @@ -0,0 +1,6 @@ +[gd_scene load_steps=2 format=3 uid="uid://col1q3elvkfwk"] + +[ext_resource type="Script" path="res://scenes/game/cursor.gd" id="1_1og6v"] + +[node name="Cursor" type="Node2D"] +script = ExtResource("1_1og6v")