1
Fork 0
mirror of https://github.com/Steffo99/hella-farm.git synced 2024-11-22 16:14:22 +00:00
hella-farm/scenes/game/cursor.gd

12 lines
304 B
GDScript3
Raw Normal View History

2024-04-17 03:26:13 +00:00
extends CharacterBody2D
class_name Cursor
2024-04-17 03:26:13 +00:00
## A [CharacterBody2D] syncing its position with the mouse on each physics timestep.
@onready var game := MainGame.get_ancestor(self)
func _physics_process(_delta: float) -> void:
2024-04-17 03:26:13 +00:00
move_and_collide(game.camera.get_global_mouse_position() - global_position)