/traderous

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

« back to all changes in this revision

Viewing changes to planet.lua

  • Committer: Josh C
  • Date: 2013-05-09 01:12:28 UTC
  • Revision ID: josh@9ix.org-20130509011228-7rp3uenr6lmpfwt8
change control scheme

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
Planet = Tile:extend {
2
 
   image = 'data/planet1.png',
3
 
   goods = {
4
 
      {'Bobble-Headed Dolls', 100},
5
 
      {'Alliance Foodstuffs', 400},
6
 
      {'Moonbrained Passengers', 6000},
7
 
   },
8
 
   onNew = function (self)
9
 
              self.indicator = Tile:new{ image = 'data/planet1ind.png' }
10
 
              the.indicators:add(self.indicator)
11
 
           end,
12
 
   onUpdate = function (self)
13
 
                 if the.keys:justPressed('l') then
14
 
                    local hw = self.width / 2
15
 
                    local pvec = vector.new(the.player.x - (self.x + hw),
16
 
                                            the.player.y - (self.y + hw))
17
 
 
18
 
                    if pvec:len2() < hw ^ 2 then
19
 
                       tradeView = TradeView:new{ planet = self }
20
 
                       tradeView:activate()
21
 
                    end
22
 
                 end
23
 
              end
24
 
}
 
 
b'\\ No newline at end of file'