diff options
Diffstat (limited to 'src/objs')
| -rw-r--r-- | src/objs/camera_comp.lua | 10 |
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 |
