/zoeplat

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

« back to all changes in this revision

Viewing changes to main.lua

  • Committer: Josh C
  • Date: 2013-04-23 16:15:50 UTC
  • Revision ID: josh@9ix.org-20130423161550-2769i8ut566706p3
don't require underscore

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
STRICT = true
2
 
DEBUG = false
 
2
DEBUG = true
3
3
 
4
4
require 'zoetrope'
5
 
__ = require 'underscore'
 
5
--__ = require 'underscore'
6
6
--inspect = require 'inspect'
7
7
require 'pepperprof'
8
8
require 'getopt_alt'
9
9
 
10
10
require 'sprite'
 
11
require 'animation'
11
12
require 'player'
 
13
require 'balloon'
 
14
require 'version'
12
15
 
13
16
util = {
14
17
   dim = function(dir)
53
56
   --        end
54
57
}
55
58
 
 
59
MenuScreen = View:extend {
 
60
   --title = Text:new{text = "Test Platform Game", font = 48, wordWrap = false},
 
61
   title = Tile:new{image = 'data/title.png', x = 0, y = 0},
 
62
   onNew = function(self)
 
63
              self:add(self.title)
 
64
              --self.title:centerAround(400, 200)
 
65
           end,
 
66
   onUpdate = function(self, elapsed)
 
67
                 if the.keys:allJustPressed() then
 
68
                    the.app.view = GameView:new()
 
69
                 end
 
70
              end
 
71
}
 
72
 
56
73
the.app = App:new {
57
74
   record = true,
58
75
   onRun = function (self)
59
 
              self.view = GameView:new()
 
76
              self.view = MenuScreen:new()
60
77
              if DEBUG then
 
78
                 self.console:watch('VERSION', 'VERSION')
61
79
                 self.console:watch('onGround', 'the.player.onGround')
62
80
                 self.console:watch('onWall', 'the.player.onWall')
63
81
                 self.console:watch('updateTook', 'the.updateTook')
78
96
                       outfile:close()
79
97
                    end
80
98
 
81
 
                    if self.record then
 
99
                    if self.record and the.recorder then
82
100
                       if not love.filesystem.remove('record.lua') then
83
101
                          print('could not remove record.lua')
84
102
                       end