aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/objs/player.lua2
-rw-r--r--src/scenes/game.lua1
2 files changed, 3 insertions, 0 deletions
diff --git a/src/objs/player.lua b/src/objs/player.lua
index 55a8ebe..5c7da0f 100644
--- a/src/objs/player.lua
+++ b/src/objs/player.lua
@@ -119,6 +119,8 @@ function new_player(x, y)
layers = {},
mask = { "Hard" },
})
+ add_comp(ent, "Camera")
+ set_active_camera(ent.camera)
add_comp(ent, "Sprite", "res/img/player.ase", {
offsetx = 0.5,
diff --git a/src/scenes/game.lua b/src/scenes/game.lua
index 4a31a99..45083ca 100644
--- a/src/scenes/game.lua
+++ b/src/scenes/game.lua
@@ -8,6 +8,7 @@ function start_game_scene()
event_bind(scn.on_update, "Sprite", sprite_anim_sys)
event_bind(scn.on_update, "Speck_System", speck_update_sys)
event_bind(scn.on_update, "Speck_Entity", speck_entity_system)
+ event_bind(scn.on_update, "Camera", camera_move_system)
event_bind(scn.on_draw, "Sprite", sprite_draw_sys)
event_bind(scn.on_draw, "Tilemap", tilemap_draw_sys)