/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
69
 
63
 
                    if math.random(1,5) == 1 then
64
 
                       the.clones.sprites[math.random(the.clones:count())].fill = {0,255,0}
 
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
65
75
                    end
66
76
 
67
77
                    the.player.moved = false
79
89
   onRun = function (self)
80
90
              print('Version: ' .. VERSION)
81
91
 
82
 
              self.view = GameView:new()
 
92
              self.view = GameView:new{level = 1}
83
93
 
84
94
              if DEBUG then
85
95
                 self.console:watch('VERSION', 'VERSION')
 
96
                 self.console:watch('level', 'the.view.level')
86
97
 
87
98
                 -- back off that dark overlay a bit
88
99
                 self.console.fill.fill[4] = 75