/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-16 02:07:23 UTC
  • Revision ID: josh@9ix.org-20130516020723-ntq1ydr2fczd9w5b
stick things into layers

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'
6
5
vector = require 'vector'
7
6
 
8
7
require 'group'
15
14
require 'cursor'
16
15
require 'bullet'
17
16
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()
 
90
 
86
91
              the.bg = Tile:new{
87
92
                 image = 'data/stars3.png',
88
93
                 -- 1366x768 * 3
97
102
 
98
103
              --self:add(Enemy:new{x=400, y=300})
99
104
 
 
105
              self:add(the.bullets)
 
106
              self:add(the.rockColliders)
 
107
              self:add(the.mirrors)
 
108
              self:add(the.rocks)
 
109
 
100
110
              the.cursor = Cursor:new()
101
111
              self:add(the.cursor)
102
112
 
133
143
                        end
134
144
                    end
135
145
 
136
 
                    self:add(unseenRock)
 
146
                    the.rocks:add(unseenRock)
137
147
 
138
148
                    self.lastRock = love.timer.getTime()
139
149
                 end
 
150
 
 
151
                 the.bullets:collide(the.rockColliders)
140
152
              end,
141
153
   draw = function (self, x, y)
142
154
             View.draw(self, x, y)