/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-10 23:47:59 UTC
  • Revision ID: josh@9ix.org-20130410234759-nrzne3xed1puy1v2
put sprite and player in their own files

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
require 'pepperprof'
8
8
require 'getopt_alt'
9
9
 
10
 
require 'sprite'
11
 
require 'animation'
12
 
require 'player'
13
 
require 'balloon'
14
 
require 'version'
15
 
 
16
10
util = {
17
11
   dim = function(dir)
18
12
      if dir == 'x' then
56
50
   --        end
57
51
}
58
52
 
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
53
the.app = App:new {
74
54
   record = true,
75
55
   onRun = function (self)
76
 
              self.view = MenuScreen:new()
77
 
              if DEBUG then
78
 
                 self.console:watch('VERSION', 'VERSION')
79
 
                 self.console:watch('onGround', 'the.player.onGround')
80
 
                 self.console:watch('onWall', 'the.player.onWall')
81
 
                 self.console:watch('updateTook', 'the.updateTook')
82
 
                 self.console:watch('drawTook', 'the.drawTook')
83
 
                 self.console:watch('recorder state', 'the.recorder.state')
84
 
              end
 
56
              self.view = GameView:new()
 
57
              self.console:watch('onGround', 'the.player.onGround')
 
58
              self.console:watch('onWall', 'the.player.onWall')
 
59
              self.console:watch('updateTook', 'the.updateTook')
 
60
              self.console:watch('drawTook', 'the.drawTook')
 
61
              self.console:watch('recorder state', 'the.recorder.state')
85
62
 
86
63
              --the.profiler = newProfiler('time', 2000)
87
64
              --the.profiler = newProfiler()
96
73
                       outfile:close()
97
74
                    end
98
75
 
99
 
                    if self.record and the.recorder then
 
76
                    if self.record then
100
77
                       if not love.filesystem.remove('record.lua') then
101
78
                          print('could not remove record.lua')
102
79
                       end