/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-11 00:15:03 UTC
  • Revision ID: josh@9ix.org-20130411001503-u3hxmtsjcw9i3lo7
actually make separate player/sprite work.  clean up some code that 
assumes debug mode

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
STRICT = true
2
 
DEBUG = true
 
2
DEBUG = false
3
3
 
4
4
require 'zoetrope'
5
5
__ = require 'underscore'
8
8
require 'getopt_alt'
9
9
 
10
10
require 'sprite'
11
 
require 'animation'
12
11
require 'player'
13
 
require 'balloon'
14
 
require 'version'
15
12
 
16
13
util = {
17
14
   dim = function(dir)
56
53
   --        end
57
54
}
58
55
 
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
 
 
73
56
the.app = App:new {
74
57
   record = true,
75
58
   onRun = function (self)
76
 
              self.view = MenuScreen:new()
 
59
              self.view = GameView:new()
77
60
              if DEBUG then
78
 
                 self.console:watch('VERSION', 'VERSION')
79
61
                 self.console:watch('onGround', 'the.player.onGround')
80
62
                 self.console:watch('onWall', 'the.player.onWall')
81
63
                 self.console:watch('updateTook', 'the.updateTook')
96
78
                       outfile:close()
97
79
                    end
98
80
 
99
 
                    if self.record and the.recorder then
 
81
                    if self.record then
100
82
                       if not love.filesystem.remove('record.lua') then
101
83
                          print('could not remove record.lua')
102
84
                       end