13
elseif dir == 'y' then
16
if STRICT then error('dir '..dir) end
21
GameView = View:extend {
22
onNew = function (self)
23
t = Text:new{y = 300, width = the.app.width, align = 'center',
24
text = 'This space intentionally left blank'}
27
--self:loadLayers('data/map.lua')
28
--self.focus = the.player
29
--self:clampTo(self.map)
31
draw = function (self, x, y)
33
love.graphics.print('FPS:' .. love.timer.getFPS(), 20, 20)
37
MenuScreen = View:extend {
38
title = Text:new{text = "Press a key to start", font = 48, wordWrap = false},
39
--title = Tile:new{image = 'data/title.png', x = 0, y = 0},
40
onNew = function(self)
42
self.title:centerAround(400, 200)
44
onUpdate = function(self, elapsed)
45
if the.keys:allJustPressed() then
46
the.app.view = GameView:new()
53
onRun = function (self)
54
self.view = MenuScreen:new()
56
self.console:watch('VERSION', 'VERSION')
57
self.console:watch('updateTook', 'the.updateTook')
58
--self.console:watch('drawTook', 'the.drawTook')
61
onUpdate = function (self, dt)
62
if the.keys:justPressed('escape') then
66
update = function (self, dt)
67
the.updateStart = love.timer.getMicroTime()
69
if the.updateStart then
70
the.updateTook = love.timer.getMicroTime() - the.updateStart