/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-07 21:30:17 UTC
  • Revision ID: josh@9ix.org-20130507213017-i9xbjk0qjjqe91dk
constant velocity for bullets.  using hump.vector e9b86ef 

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
--__ = require 'underscore'
6
6
vector = require 'vector'
7
7
 
8
 
require 'group'
9
 
 
10
8
require 'version'
11
 
require 'wrap_tile'
12
9
require 'player'
13
10
require 'enemy'
14
11
require 'cursor'
26
23
 
27
24
GameView = View:extend {
28
25
   onNew = function (self)
29
 
              -- for x = 1,30 do
30
 
              --    for y = 1,30 do
31
 
              --       self:add(Fill:new{x=x*400, y=y*400,
32
 
              --                         width = 32, height = 32,
33
 
              --                         fill = {0,0,255}
34
 
              --                      })
35
 
              --    end
36
 
              -- end
37
 
 
38
 
              the.bg = Tile:new{
39
 
                 image = 'data/stars3.png',
40
 
                 -- 1366x768 * 3
41
 
                 width = 4098,
42
 
                 height = 2304
43
 
              }
44
 
              self:add(the.bg)
 
26
              for x = 1,30 do
 
27
                 for y = 1,30 do
 
28
                    self:add(Fill:new{x=x*400, y=y*400,
 
29
                                      width = 32, height = 32,
 
30
                                      fill = {0,0,255}
 
31
                                   })
 
32
                 end
 
33
              end
45
34
 
46
35
              --the.player = CrystalPlayer:new{x=400,y=300}
47
 
              the.player = SpacePlayer:new{x=1366,y=768}
 
36
              the.player = SpacePlayer:new{x=400,y=300}
48
37
              self:add(the.player)
49
38
 
50
39
              self:add(Enemy:new{x=400, y=300})
51
40
 
52
 
              the.cursor = Cursor:new()
53
 
              self:add(the.cursor)
 
41
              self:add(Cursor:new())
54
42
 
55
43
              love.mouse.setGrab(true)
56
44
              love.mouse.setVisible(false)
86
74
              if DEBUG then
87
75
                 self.console:watch('VERSION', 'VERSION')
88
76
                 self.console:watch('updateTook', 'the.updateTook')
89
 
                 self.console:watch('the.player.x', 'the.player.x')
90
 
                 self.console:watch('the.player.y', 'the.player.y')
91
 
                 self.console:watch('the.app.width', 'the.app.width')
92
 
                 self.console:watch('the.app.height', 'the.app.height')
93
77
                 --self.console:watch('drawTook', 'the.drawTook')
94
 
 
95
 
                 -- back off that dark overlay a bit
96
 
                 self.console.fill.fill[4] = 75
97
78
              end
98
79
           end,
99
80
   onUpdate = function (self, dt)