/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 00:42:25 UTC
  • Revision ID: josh@9ix.org-20130410004225-ok7v6kq2g632mqmv
playing with text (disabled)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
STRICT = true
2
2
DEBUG = true
 
3
RECORD = true
 
4
PLAYBACK = false
3
5
 
4
6
require 'zoetrope'
5
7
__ = require 'underscore'
6
8
--inspect = require 'inspect'
7
9
require 'pepperprof'
8
 
require 'getopt_alt'
9
10
 
10
11
util = {
11
12
   dim = function(dir)
261
262
 
262
263
              the.recorder = Recorder:new{mousePosInterval = 9999}
263
264
              the.app.meta:add(the.recorder)
264
 
              if the.app.record then
 
265
              if RECORD then
265
266
                 the.recorder:startRecording()
266
 
              elseif the.app.playback then
 
267
              elseif PLAYBACK then
267
268
                 local storage = Storage:new{filename = 'record.lua'}
268
269
                 storage:load()
269
270
                 --print(inspect(storage.data))
285
286
}
286
287
 
287
288
the.app = App:new {
288
 
   record = true,
289
289
   onRun = function (self)
290
290
              self.view = GameView:new()
291
291
              self.console:watch('onGround', 'the.player.onGround')
307
307
                       outfile:close()
308
308
                    end
309
309
 
310
 
                    if self.record then
 
310
                    if RECORD then
311
311
                       if not love.filesystem.remove('record.lua') then
312
 
                          print('could not remove record.lua')
 
312
                          error('could not remove record.lua')
313
313
                       end
314
314
                       local storage = Storage:new{
315
315
                          data = the.recorder.record,
330
330
               end
331
331
            end
332
332
}
333
 
 
334
 
function love.load (arg)
335
 
   opts = getopt(arg, '')
336
 
   if opts['p'] then
337
 
      the.app.playback = true
338
 
      the.app.record = false
339
 
   elseif opts['r'] then
340
 
      the.app.record = true
341
 
   end
342
 
 
343
 
   the.app:run()
344
 
end
 
 
b'\\ No newline at end of file'