/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 02:53:43 UTC
  • Revision ID: josh@9ix.org-20131215025343-wjhcv7nbmqffg4ga
oops, mobile goal file

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.clones:collide(the.player)
51
 
                    the.goalPerson:collide(the.player)
52
 
 
53
 
                    if self.level ~= 2 then
54
 
                       the.goalPerson:doMove()
55
 
                    end
 
50
                    the.goalPerson:doMove()
56
51
 
57
52
                    for _, np in ipairs(the.clones.sprites) do
58
53
                       np:doMove()
59
54
                    end
60
55
 
61
 
                    -- yeah, again.  once for flip, twice for displace
62
 
                    the.clones:collide(the.player)
63
 
 
64
56
                    the.clones:collide(self.map)
65
57
                    the.player:collide(self.map)
66
58
                    the.goalPerson:collide(self.map)
67
59
 
68
60
                    the.clones:collide()
 
61
                    the.clones:collide(the.player)
69
62
 
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
 
63
                    if math.random(1,5) == 1 then
 
64
                       the.clones.sprites[math.random(the.clones:count())].fill = {0,255,0}
75
65
                    end
76
66
 
77
67
                    the.player.moved = false
89
79
   onRun = function (self)
90
80
              print('Version: ' .. VERSION)
91
81
 
92
 
              self.view = GameView:new{level = 1}
 
82
              self.view = GameView:new()
93
83
 
94
84
              if DEBUG then
95
85
                 self.console:watch('VERSION', 'VERSION')
96
 
                 self.console:watch('level', 'the.view.level')
97
86
 
98
87
                 -- back off that dark overlay a bit
99
88
                 self.console.fill.fill[4] = 75