aboutsummaryrefslogtreecommitdiff
path: root/src/scenes/game.lua
blob: 918caa92c1f5043ac69afbc80dfe2e52e070ce0e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
function start_game_scene()
  local scn = new_scene()

  event_bind(scn.on_update, "Player", player_update_sys)

  event_bind(scn.on_update, "Room_Editor", room_editor_ui_sys)
  event_bind(scn.on_ui, "Room_Editor", tile_place_sys)
  event_bind(scn.on_draw, "Editor_Entity", draw_editor_entity_sys)
  event_bind(scn.on_ui, "Editor_Entity", editor_entity_ui_sys)

  set_scene(scn)

  local tilemap = new_tilemap(64, 64)
  scn.tilemap = tilemap

  for x=2, 12 do
    set_tile(tilemap, x, 10, 1)
  end

  player = new_player(100, 100)

  local room_editor = new_entity()
  add_comp(room_editor, "Room_Editor")
end