From a63e57ff889cf1528c6b96aa82f2798bf399de0b Mon Sep 17 00:00:00 2001 From: Aki Date: Fri, 5 Aug 2016 17:30:34 +0200 Subject: Map themes added --- assets/music/rill.ogg | Bin 0 -> 2755347 bytes assets/music/sorona.ogg | Bin 0 -> 3242397 bytes maps/default.lua | 1 + maps/ribbit.lua | 1 + maps/rill.lua | 7 ++++--- world.lua | 9 ++++++++- 6 files changed, 14 insertions(+), 4 deletions(-) create mode 100644 assets/music/rill.ogg create mode 100644 assets/music/sorona.ogg diff --git a/assets/music/rill.ogg b/assets/music/rill.ogg new file mode 100644 index 0000000..b36a2dd Binary files /dev/null and b/assets/music/rill.ogg differ diff --git a/assets/music/sorona.ogg b/assets/music/sorona.ogg new file mode 100644 index 0000000..5b2bb2f Binary files /dev/null and b/assets/music/sorona.ogg 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() -- cgit v1.1