summaryrefslogtreecommitdiffhomepage
path: root/world.lua
diff options
context:
space:
mode:
authorAki <nthirtyone@gmail.com>2016-08-05 17:30:34 +0200
committerAki <nthirtyone@gmail.com>2016-08-05 17:30:34 +0200
commita63e57ff889cf1528c6b96aa82f2798bf399de0b (patch)
tree62e9e5b9923eb79b682107cb2997eb33f6939089 /world.lua
parent7797cbb04649ad7311d89d7fc081db3a1a490ac3 (diff)
downloadroflnauts-a63e57ff889cf1528c6b96aa82f2798bf399de0b.zip
roflnauts-a63e57ff889cf1528c6b96aa82f2798bf399de0b.tar.gz
roflnauts-a63e57ff889cf1528c6b96aa82f2798bf399de0b.tar.bz2
Map themes added
Diffstat (limited to 'world.lua')
-rw-r--r--world.lua9
1 files changed, 8 insertions, 1 deletions
diff --git a/world.lua b/world.lua
index d5e67fd..8ee27fe 100644
--- a/world.lua
+++ b/world.lua
@@ -30,7 +30,9 @@ World = {
-- Gameplay status
lastNaut = false,
-- "WINNER"
- win_move = 0
+ win_move = 0,
+ -- Music
+ music = nil
}
-- Constructor of `World` ZA WARUDO!
@@ -65,6 +67,8 @@ function World:new(map, ...)
o:spawnNauts(...)
-- Create camera
o.camera = Camera:new(o)
+ -- Play music
+ o.music = Music:new(o.map.theme)
return o
end
@@ -77,6 +81,7 @@ function World:delete()
for _,naut in pairs(self.Nauts) do
naut:delete()
end
+ self.music:delete()
self = nil
end
@@ -322,6 +327,7 @@ function World:draw()
if debug then
local c = self.camera
local w, h = love.graphics.getWidth(), love.graphics.getHeight()
+ -- draw map center
love.graphics.setColor(130,130,130)
love.graphics.setLineWidth(1)
love.graphics.setLineStyle("rough")
@@ -332,6 +338,7 @@ function World:draw()
local x1, y1 = c:translatePosition(cx, self.map.center_y)
local x2, y2 = c:translatePosition(cx+w, self.map.center_y)
love.graphics.line(x1,y1,x2,y2)
+ -- draw ox, oy
love.graphics.setColor(200,200,200)
love.graphics.setLineStyle("rough")
local cx, cy = c:getPositionScaled()