/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-19 01:35:57 UTC
  • Revision ID: josh@9ix.org-20130419013557-jbmje9kqsagj0x3j
title screen

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