/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
65
 
                       the.clones.sprites[math.random(the.clones:count())].image = 'data/goal.png'
 
70
                    if math.random(1,6) == 1 then
 
71
                       local c = the.clones.sprites[math.random(the.clones:count())]
 
72
                       if self.level == 3 and not c.cured then
 
73
                          c.image = 'data/goal.png'
 
74
                       end
66
75
                    end
67
76
 
68
77
                    the.player.moved = false
80
89
   onRun = function (self)
81
90
              print('Version: ' .. VERSION)
82
91
 
83
 
              self.view = GameView:new()
 
92
              self.view = GameView:new{level = 1}
84
93
 
85
94
              if DEBUG then
86
95
                 self.console:watch('VERSION', 'VERSION')
 
96
                 self.console:watch('level', 'the.view.level')
87
97
 
88
98
                 -- back off that dark overlay a bit
89
99
                 self.console.fill.fill[4] = 75