/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-13 21:25:26 UTC
  • Revision ID: josh@9ix.org-20130513212526-3q6md6n9xzhcmoa6
and that fixes the corner bug

Show diffs side-by-side

added added

removed removed

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