/traderous

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

« back to all changes in this revision

Viewing changes to player.lua

  • Committer: Josh C
  • Date: 2013-06-25 18:23:38 UTC
  • Revision ID: josh@9ix.org-20130625182338-gkx8evr4z93zh9x7
load/save (not working yet)

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
   money = 2000, -- what to use for money symbol? ✪ or ☥ or Ⓐ?
30
30
   goods = {},
31
31
   cargoSpace = 20,
32
 
   onPlanet = false,
33
 
   kills = 0,
34
32
   onNew = function(self)
35
33
              self.thrust = Tile:new{image = 'data/thrust.png'}
36
34
              self.shield = Shield:new{ship = self}
110
108
                  end
111
109
 
112
110
                  if not self.active then
113
 
                     the.interface:add(GameOver:new())
 
111
                     the.over.visible = true
 
112
                     the.instructions.visible = true
114
113
                  end
115
114
               end,
116
115
   buy = function(self, good, price)
132
131
                       end
133
132
 
134
133
                       return self.cargoSpace - cargo
135
 
                    end,
136
 
   save = function(self)
137
 
             -- save player data
138
 
             the.storage.data.player = {x = self.x,
139
 
                                        y = self.y,
140
 
                                        money = self.money,
141
 
                                        goods = self.goods,
142
 
                                        cargoSpace = self.cargoSpace
143
 
                                     }
144
 
             the.storage:save()
145
 
          end
 
134
                    end
146
135
}
 
 
b'\\ No newline at end of file'