aboutsummaryrefslogtreecommitdiff
path: root/src/objs/camera_comp.lua
blob: 3b8edf466eda88537c4d395625de8e65a3a8a195 (plain)
1
2
3
4
5
6
7
8
9
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