/ld27

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

« back to all changes in this revision

Viewing changes to main.lua

  • Committer: Josh C
  • Date: 2013-08-25 02:26:10 UTC
  • Revision ID: josh@9ix.org-20130825022610-13j6ydir3gmihiwz
.bzrignore

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
require 'zoetrope'
5
5
--require 'pepperprof'
6
6
 
 
7
--require 'group'
 
8
 
7
9
require 'version'
 
10
--require 'wrap_tile'
8
11
require 'player'
9
12
require 'goal'
10
 
require 'pause_view'
11
13
 
12
14
GameView = View:extend {
13
15
   gameStart = 0,
56
58
                 end
57
59
 
58
60
                 if not (DEBUG and the.console.visible) then
59
 
                    the.activeMaze:collide(the.player.collider)
60
 
                    the.player.collider:collide(the.activeGoal)
 
61
                    the.activeMaze:collide(the.player)
 
62
                    the.player:collide(the.activeGoal)
61
63
                 end
62
64
 
63
 
                 if the.keys:justPressed('escape', 'q') then
64
 
                    PauseView:new():activate()
65
 
                 end
 
65
                 -- for _, mirror in ipairs(the.mirrors.sprites) do
 
66
                 --    if not mirror.of then
 
67
                 --       print('mirror:' .. inspect(mirror))
 
68
                 --       error('mirror OF NOTHING')
 
69
                 --    end
 
70
                 -- end
66
71
              end,
67
72
   switchMaze = function(self)
68
73
                   if the.activeMaze then
92
97
                      the.activeGoal.visible = true
93
98
                   end
94
99
                   the.player.scale = the.activeMaze.playerScale
95
 
                   the.player.collider.width = the.player.width * the.activeMaze.playerScale
96
 
                   the.player.collider.height = the.player.height * the.activeMaze.playerScale
97
100
 
98
101
                   self._fx = {0,0,0,0}
99
102
                   self.tween:start(self._fx, 4, 175, 10, 'quadIn')
134
137
              end
135
138
           end,
136
139
   onUpdate = function (self, dt)
 
140
                 if the.keys:justPressed('escape') then
 
141
                    if the.profiler then
 
142
                       the.profiler:stop()
 
143
                       local outfile = io.open( "profile.txt", "w+" )
 
144
                       the.profiler:report( outfile )
 
145
                       outfile:close()
 
146
                    end
 
147
 
 
148
                    self.quit()
 
149
                 end
137
150
              end
138
151
}