/ld28

To get this branch, use:
bzr branch http://9ix.org/bzr/ld28

« back to all changes in this revision

Viewing changes to main.lua

  • Committer: Josh C
  • Date: 2013-12-14 02:57:47 UTC
  • Revision ID: josh@9ix.org-20131214025747-etw31g9vii33qvey
zoetrope 1.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
STRICT = true
2
 
DEBUG = true
3
 
 
4
 
require 'zoetrope'
5
 
deque = require 'deque'
6
 
 
7
 
require 'version'
8
 
require 'player'
9
 
 
10
 
GameView = View:extend {
11
 
   onNew = function (self)
12
 
              --self:loadLayers('data/map.lua')
13
 
              --self.focus = the.player
14
 
              --self:clampTo(self.bg)
15
 
 
16
 
              the.player = Player:new{x = the.app.width / 2,
17
 
                                      y = the.app.height / 2}
18
 
              self:add(the.player)
19
 
           end,
20
 
   onUpdate = function(self, dt)
21
 
                 if the.keys:justPressed('escape', 'q') then
22
 
                    the.app:quit()
23
 
                 end
24
 
              end,
25
 
}
26
 
 
27
 
the.app = App:new {
28
 
   name = "LD Warmup",
29
 
   onRun = function (self)
30
 
              print('Version: ' .. VERSION)
31
 
 
32
 
              self.view = GameView:new()
33
 
 
34
 
              if DEBUG then
35
 
                 self.console:watch('VERSION', 'VERSION')
36
 
 
37
 
                 -- back off that dark overlay a bit
38
 
                 self.console.fill.fill[4] = 75
39
 
              end
40
 
           end,
41
 
}