/traderous

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

« back to all changes in this revision

Viewing changes to main.lua

  • Committer: Josh C
  • Date: 2013-05-14 00:15:01 UTC
  • Revision ID: josh@9ix.org-20130514001501-z14e702ncp21s0yr
try to not spawn rocks where you can see them.  not working if screen 
crosses game boundaries.

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