/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-06-26 00:45:08 UTC
  • Revision ID: josh@9ix.org-20130626004508-6in13i6vjpu77els
give planets names

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
require 'trade_view'
21
21
require 'shield'
22
22
require 'pause_view'
 
23
require 'game_over'
23
24
 
24
25
util = {
25
26
   signOf = function(value)
71
72
                                    x = planet.x,
72
73
                                    y = planet.y,
73
74
                                    rotation = planet.rotation,
74
 
                                    goods = planet.goods
 
75
                                    goods = planet.goods,
 
76
                                    name = planet.name
75
77
                                 })
76
78
                 end
77
79
 
94
96
 
95
97
                 -- load player with cargo, money, position
96
98
                 the.player = SpacePlayer:new(the.storage.data.player)
 
99
 
 
100
                 -- reload storage as we've turned it all into objects
 
101
                 the.storage:load()
97
102
              end
98
103
 
99
104
              self:add(the.planets)
120
125
              the.cursor = Cursor:new()
121
126
              self:add(the.cursor)
122
127
 
123
 
              the.over = Text:new{
124
 
                 y = the.app.height / 2,
125
 
                 width = the.app.width,
126
 
                 align = 'center',
127
 
                 font = 25,
128
 
                 text = "Game Over",
129
 
                 visible = false
130
 
              }
131
 
              the.interface:add(the.over)
132
 
 
133
 
 
134
 
              the.instructions = Text:new{
135
 
                 y = the.app.height / 2 + 32,
136
 
                 width = the.app.width,
137
 
                 align = 'center',
138
 
                 font = 12,
139
 
                 text = "Press Enter to start a new game\nPress Q to quit",
140
 
                 visible = false
141
 
              }
142
 
              the.interface:add(the.instructions)
143
 
 
144
128
              love.mouse.setGrab(true)
145
129
              love.mouse.setVisible(false)
146
130
              love.mouse.setPosition(the.app.width / 2, the.app.height / 2)