aboutsummaryrefslogtreecommitdiff
path: root/src/objs
diff options
context:
space:
mode:
authorne_mene <[email protected]>2026-04-03 12:39:50 +0200
committerne_mene <[email protected]>2026-04-03 12:39:50 +0200
commitc8540ad8a6bb3f17da2b0cb87d52a232af7be127 (patch)
tree25ee7cce86ea8b08753095630c06a753b86ac65d /src/objs
parent0abd7de08d71e6260c9b0ad9f326f8c6b7536941 (diff)
camera component
Diffstat (limited to 'src/objs')
-rw-r--r--src/objs/camera_comp.lua10
1 files changed, 10 insertions, 0 deletions
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