/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-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:
20
20
require 'trade_view'
21
21
require 'shield'
22
22
require 'pause_view'
23
 
require 'game_over'
24
23
 
25
24
util = {
26
25
   signOf = function(value)
72
71
                                    x = planet.x,
73
72
                                    y = planet.y,
74
73
                                    rotation = planet.rotation,
75
 
                                    goods = planet.goods,
76
 
                                    name = planet.name
 
74
                                    goods = planet.goods
77
75
                                 })
78
76
                 end
79
77
 
96
94
 
97
95
                 -- load player with cargo, money, position
98
96
                 the.player = SpacePlayer:new(the.storage.data.player)
99
 
 
100
 
                 -- reload storage as we've turned it all into objects
101
 
                 the.storage:load()
102
97
              end
103
98
 
104
99
              self:add(the.planets)
125
120
              the.cursor = Cursor:new()
126
121
              self:add(the.cursor)
127
122
 
 
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
 
128
144
              love.mouse.setGrab(true)
129
145
              love.mouse.setVisible(false)
130
146
              love.mouse.setPosition(the.app.width / 2, the.app.height / 2)