From c8540ad8a6bb3f17da2b0cb87d52a232af7be127 Mon Sep 17 00:00:00 2001 From: ne_mene Date: Fri, 3 Apr 2026 12:39:50 +0200 Subject: camera component --- src/objs/camera_comp.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 src/objs/camera_comp.lua (limited to 'src/objs') diff --git a/src/objs/camera_comp.lua b/src/objs/camera_comp.lua new file mode 100644 index 0000000..3b8edf4 --- /dev/null +++ b/src/objs/camera_comp.lua @@ -0,0 +1,10 @@ + +register_comp("Camera", function (ent) + assert(has_comp(ent, "Position"), "Why camera when no position bruh? Are you dumb??") + ent.camera = Cam.new(ent.x, ent.y) +end) + +function camera_move_system(ent) + ent.camera.x = ent.x + ent.camera.y = ent.y +end -- cgit v1.3-2-g0d8e