5
deque = require 'deque'
11
GameView = View:extend {
12
onNew = function (self)
13
--self:loadLayers('data/map.lua')
14
--self.focus = the.player
15
--self:clampTo(self.bg)
17
the.player = Player:new{
18
x = math.random(the.app.width),
19
y = math.random(the.app.height),
23
the.notplayers = Group:new()
24
self:add(the.notplayers)
26
the.notplayers:add(NotPlayer:new {
27
x = math.random(the.app.width),
28
y = math.random(the.app.height),
32
onUpdate = function(self, dt)
33
if the.player.moved then
34
-- this should encapsulate
35
for _, np in ipairs(the.notplayers.sprites) do
39
the.player.moved = false
42
if the.keys:justPressed('escape', 'q') then
50
onRun = function (self)
51
print('Version: ' .. VERSION)
53
self.view = GameView:new()
56
self.console:watch('VERSION', 'VERSION')
58
-- back off that dark overlay a bit
59
self.console.fill.fill[4] = 75