/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-14 17:17:35 UTC
  • Revision ID: josh@9ix.org-20131214171735-aenlrspqbem3104g
screenshots

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
 
4
4
require 'zoetrope'
5
5
deque = require 'deque'
6
 
--inspect = require 'inspect'
7
 
require 'sprite'
8
6
 
9
 
require 'util'
10
7
require 'version'
11
8
require 'player'
12
9
require 'clone'
13
10
 
14
11
GameView = View:extend {
15
12
   onNew = function (self)
16
 
              self:loadLayers('data/map.lua')
 
13
              --self:loadLayers('data/map.lua')
 
14
              --self.focus = the.player
 
15
              --self:clampTo(self.bg)
17
16
 
18
17
              the.player = Player:new{
19
18
                 x = math.random(the.app.width),
25
24
              self:add(the.clones)
26
25
              for _ = 1, 14 do
27
26
                 the.clones:add(Clone:new {
28
 
                                       x = math.random(16, the.app.width-32),
29
 
                                       y = math.random(16, the.app.height-32),
 
27
                                       x = math.random(the.app.width),
 
28
                                       y = math.random(the.app.height),
30
29
                                    })
31
30
              end
32
31
           end,
37
36
                       np:doMove()
38
37
                    end
39
38
 
40
 
                    the.clones:collide(self.map)
41
 
                    the.player:collide(self.map)
42
 
 
43
 
                    the.clones:collide()
44
 
                    the.clones:collide(the.player)
45
 
 
46
39
                    the.player.moved = false
47
40
                 end
48
41