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.clones = Group:new()
26
the.clones:add(Clone: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.clones.sprites) do
40
the.clones:collide(the.player)
42
the.player.moved = false
45
if the.keys:justPressed('escape', 'q') then
53
onRun = function (self)
54
print('Version: ' .. VERSION)
56
self.view = GameView:new()
59
self.console:watch('VERSION', 'VERSION')
61
-- back off that dark overlay a bit
62
self.console.fill.fill[4] = 75
65
onUpdate = function (self, dt)
66
if the.keys:justPressed('f1') then
67
local ss = love.graphics.newScreenshot()
68
ss:encode('screenshot-' ..love.timer.getTime()..'.png')