/spacey

To get this branch, use:
bzr branch http://9ix.org/bzr/spacey

« back to all changes in this revision

Viewing changes to main.lua

  • Committer: Josh C
  • Date: 2013-05-14 16:39:54 UTC
  • Revision ID: josh@9ix.org-20130514163954-tpi9djio3pm6vswf
prepare a collision box for the rocks

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
DEBUG = true
3
3
 
4
4
require 'zoetrope'
 
5
--__ = require 'underscore'
5
6
vector = require 'vector'
6
7
 
7
8
require 'group'
14
15
require 'cursor'
15
16
require 'bullet'
16
17
require 'rock'
17
 
require 'boom'
18
18
 
19
19
util = {
20
20
   signOf = function(value)
83
83
              --    end
84
84
              -- end
85
85
 
86
 
              the.rockColliders = Group:new()
87
 
              the.bullets = Group:new()
88
 
              the.mirrors = Group:new()
89
 
              the.rocks = Group:new()
 
86
              the.rockColliders = {}
 
87
              the.bullets = {}
90
88
 
91
89
              the.bg = Tile:new{
92
90
                 image = 'data/stars3.png',
102
100
 
103
101
              --self:add(Enemy:new{x=400, y=300})
104
102
 
105
 
              self:add(the.bullets)
106
 
              self:add(the.rockColliders)
107
 
              self:add(the.mirrors)
108
 
              self:add(the.rocks)
109
 
 
110
103
              the.cursor = Cursor:new()
111
104
              self:add(the.cursor)
112
105
 
143
136
                        end
144
137
                    end
145
138
 
146
 
                    the.rocks:add(unseenRock)
 
139
                    self:add(unseenRock)
147
140
 
148
141
                    self.lastRock = love.timer.getTime()
149
142
                 end
150
 
 
151
 
                 the.bullets:collide(the.rockColliders)
152
143
              end,
153
144
   draw = function (self, x, y)
154
145
             View.draw(self, x, y)