/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:54:06 UTC
  • Revision ID: josh@9ix.org-20131215025406-l1gkpunh7xkmxlaq
and a player "graphic"

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