make simple camera

This commit is contained in:
yuki 2025-11-23 07:37:43 -03:00
parent d23a7c4c36
commit 253844755b
2 changed files with 15 additions and 0 deletions

View file

@ -0,0 +1,14 @@
class_name RoomCamera extends Camera2D
var room: Room
func _ready() -> void:
await owner.ready
room = owner as Room
assert(room != null, "The RoomCamera type must be used only in the room scene. It needs the owner to be a Room node.")
func follow_player(_delta: float) -> void:
global_position = room.player.global_position

View file

@ -0,0 +1 @@
uid://diou146pyb0br