/ld28

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

« back to all changes in this revision

Viewing changes to main.lua

  • Committer: Josh C
  • Date: 2013-12-15 17:23:16 UTC
  • Revision ID: josh@9ix.org-20131215172316-aqwbhh3lyik48fnh
levels.  ish.

Show diffs side-by-side

added added

removed removed

Lines of Context:
47
47
                 if the.player.moved then
48
48
                    -- this should encapsulate
49
49
 
50
 
                    the.goalPerson:doMove()
 
50
                    the.clones:collide(the.player)
 
51
                    the.goalPerson:collide(the.player)
 
52
 
 
53
                    if self.level ~= 2 then
 
54
                       the.goalPerson:doMove()
 
55
                    end
51
56
 
52
57
                    for _, np in ipairs(the.clones.sprites) do
53
58
                       np:doMove()
54
59
                    end
55
60
 
 
61
                    -- yeah, again.  once for flip, twice for displace
 
62
                    the.clones:collide(the.player)
 
63
 
56
64
                    the.clones:collide(self.map)
57
65
                    the.player:collide(self.map)
58
66
                    the.goalPerson:collide(self.map)
59
67
 
60
68
                    the.clones:collide()
61
 
                    the.clones:collide(the.player)
62
 
                    the.goalPerson:collide(the.player)
63
69
 
64
 
                    if math.random(1,5) == 1 then
 
70
                    if math.random(1,6) == 1 then
65
71
                       local c = the.clones.sprites[math.random(the.clones:count())]
66
 
                       if not c.cured then
 
72
                       if self.level == 3 and not c.cured then
67
73
                          c.image = 'data/goal.png'
68
74
                       end
69
75
                    end
83
89
   onRun = function (self)
84
90
              print('Version: ' .. VERSION)
85
91
 
86
 
              self.view = GameView:new()
 
92
              self.view = GameView:new{level = 1}
87
93
 
88
94
              if DEBUG then
89
95
                 self.console:watch('VERSION', 'VERSION')
 
96
                 self.console:watch('level', 'the.view.level')
90
97
 
91
98
                 -- back off that dark overlay a bit
92
99
                 self.console.fill.fill[4] = 75