5
--__ = require 'underscore'
10
GameView = View:extend {
11
onNew = function (self)
14
self:add(Fill:new{x=x*400, y=y*400,
15
width = 32, height = 32,
21
--the.player = CrystalPlayer:new{x=400,y=300}
22
the.player = SpacePlayer:new{x=400,y=300}
25
love.mouse.setGrab(true)
26
--love.mouse.setVisible(false)
28
--self:loadLayers('data/map.lua')
29
self.focus = the.player
30
--self:clampTo(self.map)
32
draw = function (self, x, y)
34
love.graphics.print('FPS:' .. love.timer.getFPS(), 20, 20)
38
MenuScreen = View:extend {
39
title = Text:new{text = "Press a key to start", font = 48, wordWrap = false},
40
--title = Tile:new{image = 'data/title.png', x = 0, y = 0},
41
onNew = function(self)
43
self.title:centerAround(400, 200)
45
onUpdate = function(self, elapsed)
46
if the.keys:allJustPressed() then
47
the.app.view = GameView:new()
53
onRun = function (self)
54
print('Version: ' .. VERSION)
55
self.view = GameView:new()
57
self.console:watch('VERSION', 'VERSION')
58
self.console:watch('updateTook', 'the.updateTook')
59
--self.console:watch('drawTook', 'the.drawTook')
62
onUpdate = function (self, dt)
63
if the.keys:justPressed('escape') then
67
update = function (self, dt)
68
the.updateStart = love.timer.getMicroTime()
70
if the.updateStart then
71
the.updateTook = love.timer.getMicroTime() - the.updateStart