summaryrefslogtreecommitdiffhomepage
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
parent7797cbb04649ad7311d89d7fc081db3a1a490ac3 (diff)
downloadroflnauts-a63e57ff889cf1528c6b96aa82f2798bf399de0b.zip
roflnauts-a63e57ff889cf1528c6b96aa82f2798bf399de0b.tar.gz
roflnauts-a63e57ff889cf1528c6b96aa82f2798bf399de0b.tar.bz2
Map themes added
-rw-r--r--assets/music/rill.oggbin0 -> 2755347 bytes
-rw-r--r--assets/music/sorona.oggbin0 -> 3242397 bytes
-rw-r--r--maps/default.lua1
-rw-r--r--maps/ribbit.lua1
-rw-r--r--maps/rill.lua7
-rw-r--r--world.lua9
6 files changed, 14 insertions, 4 deletions
diff --git a/assets/music/rill.ogg b/assets/music/rill.ogg
new file mode 100644
index 0000000..b36a2dd
--- /dev/null
+++ b/assets/music/rill.ogg
Binary files differ
diff --git a/assets/music/sorona.ogg b/assets/music/sorona.ogg
new file mode 100644
index 0000000..5b2bb2f
--- /dev/null
+++ b/assets/music/sorona.ogg
Binary files differ
diff --git a/maps/default.lua b/maps/default.lua
index fe7db97..7f4df7a 100644
--- a/maps/default.lua
+++ b/maps/default.lua
@@ -2,6 +2,7 @@
return {
-- GENERAL
name = "default",
+ theme = "sorona.ogg",
center_x = 0,
center_y = 0,
width = 360,
diff --git a/maps/ribbit.lua b/maps/ribbit.lua
index 3480845..f6908e7 100644
--- a/maps/ribbit.lua
+++ b/maps/ribbit.lua
@@ -1,6 +1,7 @@
return {
-- GENERAL
name = "ribbit",
+ theme = "sorona.ogg",
center_x = 0,
center_y = 50,
width = 360,
diff --git a/maps/rill.lua b/maps/rill.lua
index 4d2698a..59c34ca 100644
--- a/maps/rill.lua
+++ b/maps/rill.lua
@@ -1,10 +1,11 @@
return {
-- CENTER AND SIZE
name = "rill",
+ theme = "rill.ogg",
center_x = 0,
- center_y = 80,
- width = 320,
- height = 240,
+ center_y = 65,
+ width = 400,
+ height = 260,
-- RESPAWN POINTS
respawns = {
{x = -135, y = 10},
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()