/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: 2014-07-03 14:41:57 UTC
  • Revision ID: josh@9ix.org-20140703144157-xydxt62xzcdq6bdk
cluke009 zoetrope + my spritebatch changes

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
              self.maze2.playerScale = 0.5
35
35
              self.maze3.playerScale = 1
36
36
 
37
 
              self.goals = {}
 
37
              self.goals = {{},{},{}}
38
38
              the.goalsAchieved = 0
39
39
              for _, obj in ipairs(self.objects.sprites) do
40
40
                 if obj:instanceOf(Goal) then
41
41
                    obj.visible = false
42
 
                    self.goals[tonumber(obj.map)] = obj
 
42
                    table.insert(self.goals[tonumber(obj.map)], obj)
43
43
                 end
44
44
              end
45
45
 
70
70
                 end
71
71
 
72
72
                 if not (DEBUG and the.console.visible) then
73
 
                    --the.player.collider:collide(the.activeMaze)
74
 
                    the.player.collider:collide(the.activeGoal)
 
73
                    for _, goal in ipairs(the.activeGoals) do
 
74
                       the.player.collider:collide(goal)
 
75
                    end
75
76
                 end
76
77
 
77
78
                 if the.keys:justPressed('escape', 'q') then
92
93
                      the.activeBg.visible = false
93
94
                      the.activeBg = self.bgs[newMaze]
94
95
 
95
 
                      if the.activeGoal then
96
 
                         the.activeGoal.visible = false
 
96
                      for _, goal in ipairs(the.activeGoals) do
 
97
                         goal.visible = false
97
98
                      end
98
 
                      the.activeGoal = self.goals[newMaze]
 
99
                      the.activeGoals = self.goals[newMaze]
99
100
 
100
101
                      love.audio.play(self.switchSounds[math.random(#self.switchSounds)])
101
102
                   else
102
103
                      the.activeMaze = self.maze2
103
104
                      the.activeBg = self.bg
104
 
                      the.activeGoal = self.goals[2]
 
105
                      the.activeGoals = self.goals[2]
105
106
                   end
106
107
 
107
108
                   the.activeMaze:revive()
108
109
                   the.activeBg.visible = true
109
 
                   if the.activeGoal then
110
 
                      the.activeGoal.visible = true
 
110
                   for _, goal in ipairs(the.activeGoals) do
 
111
                      goal.visible = true
111
112
                   end
112
113
                   the.player.scale = the.activeMaze.playerScale
113
114
                   the.player.collider.width = the.player.width * the.activeMaze.playerScale
132
133
 
133
134
              local nr = 'data/NewRocker-Regular.otf'
134
135
              self:add(Text:new{
135
 
                          text = 'Name Of Game',
 
136
                          text = 'Treasures of the Decimaze',
136
137
                          --x = 0,
137
138
                          y = 100,
138
139
                          width = self.bg.width,
142
143
                       })
143
144
 
144
145
              self:add(Text:new{
145
 
                          text = 'Find the 3 lost shinies!',
 
146
                          text = 'Find the 4 lost shinies!',
146
147
                          y = 170,
147
148
                          width = self.bg.width,
148
149
                          font = {nr, 28},
178
179
}
179
180
 
180
181
the.app = App:new {
 
182
   name = "Treasures of the Decimaze",
181
183
   onRun = function (self)
182
184
              print('Version: ' .. VERSION)
183
185
 
193
195
              end
194
196
           end,
195
197
   onUpdate = function (self, dt)
 
198
                 if the.keys:justPressed('f1') then
 
199
                    local ss = love.graphics.newScreenshot()
 
200
                    ss:encode('screenshot-' ..love.timer.getTime()..'.png')
 
201
                 end
196
202
              end
197
203
}