/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-13 21:31:23 UTC
  • Revision ID: josh@9ix.org-20130513213123-n21tkmyb2u7xcjtz
monkey patch group to add onRemove hook.  remove mirrors on remove.

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
 
8
10
require 'version'
 
11
require 'wrap_tile'
9
12
require 'player'
10
13
require 'enemy'
11
14
require 'cursor'
32
35
              --    end
33
36
              -- end
34
37
 
35
 
              local bg = Tile:new{
36
 
                 image = 'data/stars2.png',
37
 
                 width = 102400,
38
 
                 height = 76800,
39
 
                 x = -51200,
40
 
                 y = -38400
 
38
              the.bg = Tile:new{
 
39
                 image = 'data/stars3.png',
 
40
                 -- 1366x768 * 3
 
41
                 width = 4098,
 
42
                 height = 2304
41
43
              }
42
 
              self:add(bg)
 
44
              self:add(the.bg)
43
45
 
44
46
              --the.player = CrystalPlayer:new{x=400,y=300}
45
 
              the.player = SpacePlayer:new{x=400,y=300}
 
47
              the.player = SpacePlayer:new{x=1366,y=768}
46
48
              self:add(the.player)
47
49
 
48
50
              self:add(Enemy:new{x=400, y=300})
84
86
              if DEBUG then
85
87
                 self.console:watch('VERSION', 'VERSION')
86
88
                 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')
87
93
                 --self.console:watch('drawTook', 'the.drawTook')
 
94
 
 
95
                 -- back off that dark overlay a bit
 
96
                 self.console.fill.fill[4] = 75
88
97
              end
89
98
           end,
90
99
   onUpdate = function (self, dt)