aboutsummaryrefslogtreecommitdiff
path: root/scenes/level1_scene.lua
blob: c7ad856b6c47e86ab74bedd1e199d470744e79e2 (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
26
27
28
29
30
31
32
33
34
35
36
level1 = {} -- Level1 State
require("core.screen_shaker")
Map = require("core.map")
-- imports
require("core.constants")
require("core.ambience")

function level1:init()
  constants.resetColors()
  screenShake = ScreenShaker()
  ambience = Ambience({"atmosphere1","thunder"})
  map = Map("level1")
end

function level1:enter(previous)
end

function level1:update(dt)
  map:update(dt)
  screenShake:update(dt)
end

function level1:draw()
  screenShake:draw()
  map:draw()
end

function level1:keypressed(key, scancode)
  map:keypressed(key, scancode)
end

function level1:leave()
  map = nil
end

return level1