12
GameView = View:extend {
14
onNew = function (self)
15
self:loadLayers('data/map.lua')
16
self.focus = the.player
17
self:clampTo(self.map)
19
--the.interface = Group:new()
21
--self:add(the.interface)
23
self.gameStart = love.timer.getTime()
24
self.lastChange = love.timer.getTime()
26
onUpdate = function(self, dt)
27
if the.player.active and love.timer.getTime() > self.lastChange + 10 then
30
self.lastChange = love.timer.getTime()
33
-- for _, mirror in ipairs(the.mirrors.sprites) do
34
-- if not mirror.of then
35
-- print('mirror:' .. inspect(mirror))
36
-- error('mirror OF NOTHING')
40
onEndFrame = function(self)
41
--the.interface.translate.x = the.player.x - the.app.width / 2 + the.player.width / 2
42
--the.interface.translate.y = the.player.y - the.app.height / 2 + the.player.height / 2
46
MenuScreen = View:extend {
47
title = Text:new{text = "Press a key to start", font = 48, wordWrap = false},
48
--title = Tile:new{image = 'data/title.png', x = 0, y = 0},
49
onNew = function(self)
51
self.title:centerAround(400, 200)
53
onUpdate = function(self, elapsed)
54
if the.keys:allJustPressed() then
55
the.app.view = GameView:new()
61
onRun = function (self)
62
print('Version: ' .. VERSION)
64
self.view = GameView:new()
67
self.console:watch('VERSION', 'VERSION')
69
-- back off that dark overlay a bit
70
self.console.fill.fill[4] = 75
73
onUpdate = function (self, dt)
74
if the.keys:justPressed('escape') then