From 93d3257ff23331c308fb32940557911a29ca608b Mon Sep 17 00:00:00 2001 From: Aki Date: Thu, 6 Apr 2017 19:22:26 +0200 Subject: Menu cleaned-up and moved to /not/ Menu is now similar to new code Menu.load => Menu.open --- config/menucredits.lua | 2 +- config/menuhost.lua | 4 ++-- config/menumain.lua | 6 +++--- config/menuselect.lua | 2 +- config/menusettings.lua | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) (limited to 'config') diff --git a/config/menucredits.lua b/config/menucredits.lua index 9d38da4..0510333 100644 --- a/config/menucredits.lua +++ b/config/menucredits.lua @@ -11,7 +11,7 @@ return { :setText("Go back") :setPosition(bx,144) :set("active", function (self) - self.parent:load("menumain") + self.parent:open("menumain") end) , element:new(menu) diff --git a/config/menuhost.lua b/config/menuhost.lua index 64ce0e7..ae5e3dd 100644 --- a/config/menuhost.lua +++ b/config/menuhost.lua @@ -29,14 +29,14 @@ return { end) :set("active", function (self) MAP = map_selector:getFullSelection(true)[1][1] -- please, don't kill me for this, kek - self.parent:load("menuselect") + self.parent:open("menuselect") end) , button:new(menu) :setText("Go back") :setPosition(bx,117) :set("active", function (self) - self.parent:load("menumain") + self.parent:open("menumain") end) , } \ No newline at end of file diff --git a/config/menumain.lua b/config/menumain.lua index 50b3d56..4e5ef1f 100644 --- a/config/menumain.lua +++ b/config/menumain.lua @@ -14,7 +14,7 @@ return { :setText("Start") :setPosition(bx, 80) :set("active", function (self) - self.parent:load("menuhost") + self.parent:open("menuhost") end) , button:new(menu) @@ -28,14 +28,14 @@ return { :setText("Settings") :setPosition(bx, 112) :set("active", function (self) - self.parent:load("menusettings") + self.parent:open("menusettings") end) , button:new(menu) :setText("Credits") :setPosition(bx, 128) :set("active", function (self) - self.parent:load("menucredits") + self.parent:open("menucredits") end) , button:new(menu) diff --git a/config/menuselect.lua b/config/menuselect.lua index 19f46ab..7b9f073 100644 --- a/config/menuselect.lua +++ b/config/menuselect.lua @@ -41,7 +41,7 @@ return { :setText("Go back") :setPosition(bx,150) :set("active", function (self) - self.parent:load("menuhost") + self.parent:open("menuhost") end) , element:new(menu) diff --git a/config/menusettings.lua b/config/menusettings.lua index 1631e4f..19f952e 100644 --- a/config/menusettings.lua +++ b/config/menusettings.lua @@ -105,7 +105,7 @@ local a = { :setText("Go back") :setPosition(bx,144) :set("active", function (self) - self.parent:load("menumain") + self.parent:open("menumain") end) , dimmer -- cgit v1.1 From 37767d6c54ea6af0b4631b5ce838ee584603895e Mon Sep 17 00:00:00 2001 From: Aki Date: Fri, 7 Apr 2017 02:53:36 +0200 Subject: Moved menu configs to subdirectory --- config/menucredits.lua | 24 ---------- config/menuhost.lua | 42 ----------------- config/menumain.lua | 59 ------------------------ config/menus/credits.lua | 24 ++++++++++ config/menus/host.lua | 42 +++++++++++++++++ config/menus/main.lua | 59 ++++++++++++++++++++++++ config/menus/select.lua | 73 +++++++++++++++++++++++++++++ config/menus/settings.lua | 114 ++++++++++++++++++++++++++++++++++++++++++++++ config/menuselect.lua | 73 ----------------------------- config/menusettings.lua | 114 ---------------------------------------------- 10 files changed, 312 insertions(+), 312 deletions(-) delete mode 100644 config/menucredits.lua delete mode 100644 config/menuhost.lua delete mode 100644 config/menumain.lua create mode 100644 config/menus/credits.lua create mode 100644 config/menus/host.lua create mode 100644 config/menus/main.lua create mode 100644 config/menus/select.lua create mode 100644 config/menus/settings.lua delete mode 100644 config/menuselect.lua delete mode 100644 config/menusettings.lua (limited to 'config') diff --git a/config/menucredits.lua b/config/menucredits.lua deleted file mode 100644 index 0510333..0000000 --- a/config/menucredits.lua +++ /dev/null @@ -1,24 +0,0 @@ -local menu = ... - -local button = require "button" -local element = require "element" - -local width, height = love.graphics.getWidth()/getRealScale(), love.graphics.getHeight()/getRealScale() -local bx = width/2-29 - -return { - button:new(menu) - :setText("Go back") - :setPosition(bx,144) - :set("active", function (self) - self.parent:open("menumain") - end) - , - element:new(menu) - :setPosition(width/2, 30) - :set("draw", function (self, scale) - local x,y = self:getPosition() - love.graphics.printf("A game by the Awesomenauts community including:\nSeltzy, PlasmaWisp, ParaDoX, MilkingChicken, Burningdillo, Bronkey and Aki.\n\n04font was used.\n\nBased on a game by Jan Willem Nijman, Paul Veer and Bits_Beats XOXO.\n\nAwesomenauts is property of Ronimo Games.", (x-110)*scale, (y+10)*scale, 220, "left", 0, scale, scale) - end) - , -} \ No newline at end of file diff --git a/config/menuhost.lua b/config/menuhost.lua deleted file mode 100644 index ae5e3dd..0000000 --- a/config/menuhost.lua +++ /dev/null @@ -1,42 +0,0 @@ -local menu = ... - -local button = require "button" -local selector = require "selector" - -local width, height = love.graphics.getWidth()/getScale(), love.graphics.getHeight()/getScale() -local bx = width/2-29 - -local map_selector = selector:new(menu) - -return { - map_selector - :setPosition(width/2, 40) - :setSize(80, 42) - :setMargin(0) - :set("global", true) - :set("first", true) - :set("list", require "maplist") - :set("icons_i", love.graphics.newImage("assets/maps.png")) - :set("icons_q", require "mapicons") - :set("shape", "panorama") - :init() - , - button:new(menu) - :setText("Next") - :setPosition(bx,101) - :set("isEnabled", function () - return map_selector:isLocked() - end) - :set("active", function (self) - MAP = map_selector:getFullSelection(true)[1][1] -- please, don't kill me for this, kek - self.parent:open("menuselect") - end) - , - button:new(menu) - :setText("Go back") - :setPosition(bx,117) - :set("active", function (self) - self.parent:open("menumain") - end) - , -} \ No newline at end of file diff --git a/config/menumain.lua b/config/menumain.lua deleted file mode 100644 index 4e5ef1f..0000000 --- a/config/menumain.lua +++ /dev/null @@ -1,59 +0,0 @@ -local menu = ... - -local button = require "button" -local header = require "header" -local element = require "element" - -local width, height = love.graphics.getWidth()/getScale(), love.graphics.getHeight()/getScale() -local bx = width/2-29 - -local awesometwo = love.graphics.newImage("assets/two.png") - -return { - button:new(menu) - :setText("Start") - :setPosition(bx, 80) - :set("active", function (self) - self.parent:open("menuhost") - end) - , - button:new(menu) - :setText("Join") - :setPosition(bx, 96) - :set("isEnabled", function (self) - return false - end) - , - button:new(menu) - :setText("Settings") - :setPosition(bx, 112) - :set("active", function (self) - self.parent:open("menusettings") - end) - , - button:new(menu) - :setText("Credits") - :setPosition(bx, 128) - :set("active", function (self) - self.parent:open("menucredits") - end) - , - button:new(menu) - :setText("Exit") - :setPosition(bx, 144) - :set("active", love.event.quit) - , - element:new(menu) - :setPosition(width/2, 15) - :set("draw", function (self, scale) - local x,y = self:getPosition() - love.graphics.setColor(255, 255, 255, 255) - love.graphics.setFont(Bold) - love.graphics.draw(awesometwo, x*scale, y*scale, 0, scale, scale, 35) - end) - , - header:new(menu) - :setText("Roflnauts") - :setPosition(width/2,40) - , -} \ No newline at end of file diff --git a/config/menus/credits.lua b/config/menus/credits.lua new file mode 100644 index 0000000..6ba04b3 --- /dev/null +++ b/config/menus/credits.lua @@ -0,0 +1,24 @@ +local menu = ... + +local button = require "button" +local element = require "element" + +local width, height = love.graphics.getWidth()/getRealScale(), love.graphics.getHeight()/getRealScale() +local bx = width/2-29 + +return { + button:new(menu) + :setText("Go back") + :setPosition(bx,144) + :set("active", function (self) + self.parent:open("main") + end) + , + element:new(menu) + :setPosition(width/2, 30) + :set("draw", function (self, scale) + local x,y = self:getPosition() + love.graphics.printf("A game by the Awesomenauts community including:\nSeltzy, PlasmaWisp, ParaDoX, MilkingChicken, Burningdillo, Bronkey and Aki.\n\n04font was used.\n\nBased on a game by Jan Willem Nijman, Paul Veer and Bits_Beats XOXO.\n\nAwesomenauts is property of Ronimo Games.", (x-110)*scale, (y+10)*scale, 220, "left", 0, scale, scale) + end) + , +} \ No newline at end of file diff --git a/config/menus/host.lua b/config/menus/host.lua new file mode 100644 index 0000000..47aaa5e --- /dev/null +++ b/config/menus/host.lua @@ -0,0 +1,42 @@ +local menu = ... + +local button = require "button" +local selector = require "selector" + +local width, height = love.graphics.getWidth()/getScale(), love.graphics.getHeight()/getScale() +local bx = width/2-29 + +local map_selector = selector:new(menu) + +return { + map_selector + :setPosition(width/2, 40) + :setSize(80, 42) + :setMargin(0) + :set("global", true) + :set("first", true) + :set("list", require "maplist") + :set("icons_i", love.graphics.newImage("assets/maps.png")) + :set("icons_q", require "mapicons") + :set("shape", "panorama") + :init() + , + button:new(menu) + :setText("Next") + :setPosition(bx,101) + :set("isEnabled", function () + return map_selector:isLocked() + end) + :set("active", function (self) + MAP = map_selector:getFullSelection(true)[1][1] -- please, don't kill me for this, kek + self.parent:open("select") + end) + , + button:new(menu) + :setText("Go back") + :setPosition(bx,117) + :set("active", function (self) + self.parent:open("main") + end) + , +} \ No newline at end of file diff --git a/config/menus/main.lua b/config/menus/main.lua new file mode 100644 index 0000000..661299c --- /dev/null +++ b/config/menus/main.lua @@ -0,0 +1,59 @@ +local menu = ... + +local button = require "button" +local header = require "header" +local element = require "element" + +local width, height = love.graphics.getWidth()/getScale(), love.graphics.getHeight()/getScale() +local bx = width/2-29 + +local awesometwo = love.graphics.newImage("assets/two.png") + +return { + button:new(menu) + :setText("Start") + :setPosition(bx, 80) + :set("active", function (self) + self.parent:open("host") + end) + , + button:new(menu) + :setText("Join") + :setPosition(bx, 96) + :set("isEnabled", function (self) + return false + end) + , + button:new(menu) + :setText("Settings") + :setPosition(bx, 112) + :set("active", function (self) + self.parent:open("settings") + end) + , + button:new(menu) + :setText("Credits") + :setPosition(bx, 128) + :set("active", function (self) + self.parent:open("credits") + end) + , + button:new(menu) + :setText("Exit") + :setPosition(bx, 144) + :set("active", love.event.quit) + , + element:new(menu) + :setPosition(width/2, 15) + :set("draw", function (self, scale) + local x,y = self:getPosition() + love.graphics.setColor(255, 255, 255, 255) + love.graphics.setFont(Bold) + love.graphics.draw(awesometwo, x*scale, y*scale, 0, scale, scale, 35) + end) + , + header:new(menu) + :setText("Roflnauts") + :setPosition(width/2,40) + , +} \ No newline at end of file diff --git a/config/menus/select.lua b/config/menus/select.lua new file mode 100644 index 0000000..452a3bf --- /dev/null +++ b/config/menus/select.lua @@ -0,0 +1,73 @@ +local menu = ... + +local button = require "button" +local selector = require "selector" +local element = require "element" + +local width, height = love.graphics.getWidth()/getScale(), love.graphics.getHeight()/getScale() +local bx = width/2-29 + +local naut_selector = selector:new(menu) +local start_button = button:new(menu) + +return { + naut_selector + :setPosition(width/2,60) + :setMargin(8) + :setSize(32, 32) + :set("list", require "nautslist") + :set("global", false) + :set("icons_i", love.graphics.newImage("assets/portraits.png")) + :set("icons_q", require "nautsicons") + :init() + , + start_button + :setText("Force start") + :setPosition(bx,134) + :set("isEnabled", function () + if #naut_selector:getFullSelection(false) > 1 then + return true + end + return false + end) + :set("active", function (self) + local nauts = naut_selector:getFullSelection(false) + if #nauts > 1 then + changeScene(World:new(MAP, nauts)) + end + end) + , + button:new(menu) + :setText("Go back") + :setPosition(bx,150) + :set("active", function (self) + self.parent:open("host") + end) + , + element:new(menu) + :setPosition(bx, 101) + :set("the_final_countdown", 9) + :set("draw", function (self, scale) + if self.the_final_countdown ~= 9 then + local x,y = self:getPosition() + local countdown = math.max(1, math.ceil(self.the_final_countdown)) + love.graphics.setColor(255, 255, 255, 255) + love.graphics.setFont(Font) + love.graphics.print("Autostart in:", (x-16)*scale, (y+10)*scale, 0, scale, scale) + love.graphics.setFont(Bold) + love.graphics.printf(countdown, (x+40)*scale, (y)*scale, 36, "center", 0, scale, scale) + end + end) + :set("update", function (self, dt) + local total = #naut_selector:getFullSelection(false) + if total > 1 then + self.the_final_countdown = self.the_final_countdown - dt + else + self.the_final_countdown = 9 + end + if self.the_final_countdown < 0 then + start_button:active() + end + end) + , +} \ No newline at end of file diff --git a/config/menus/settings.lua b/config/menus/settings.lua new file mode 100644 index 0000000..bfdfc6e --- /dev/null +++ b/config/menus/settings.lua @@ -0,0 +1,114 @@ +local menu = ... + +local button = require "button" +local selector = require "selector" +local element = require "element" + +local width, height = love.graphics.getWidth()/getRealScale(), love.graphics.getHeight()/getRealScale() +local bx = width/2-29 + +local keys = {"Left", "Right", "Up", "Down", "Attack", "Jump"} + +local dimmer = element:new(menu) + :setPosition(width/2, 15) + :set("visible", false) + :set("currentControl", "Left") -- it actually means control that is being set CURRENTLY + :set("previousControl", "") -- it actually means key that was set as this control PREVIOUSLY + :set("draw", function (self, scale) + if self.visible then + love.graphics.setColor(0, 0, 0, 210) + love.graphics.rectangle("fill",0,0,width*getRealScale(),height*getRealScale()) + love.graphics.setColor(120, 255, 120, 255) + love.graphics.printf("Press new key for: \n> " .. self.currentControl .. " <", (width/2-110)*scale, (height/2-4)*scale, 220, "center", 0, scale, scale) + love.graphics.setColor(120, 120, 120, 255) + love.graphics.printf("Old: " .. self.previousControl .. "", (width/2-110)*scale, (height/2+16)*scale, 220, "center", 0, scale, scale) + love.graphics.setColor(255, 255, 255, 255) + end + end) + +-- CHANGER functions +local isEnabled = function (self) + if Controller.getSets()[self.setNumber()] and not self.inProgress then + return true + else + return false + end +end +local startChange = function (self) + dimmer:set("visible", true):set("currentControl", "Left") + self.parent.allowMove = false + self.inProgress = true + self.currentKey = 0 + -- Displaying old key should be done less tricky; REWORK NEEDED + dimmer:set("previousControl", Controller.sets[self.setNumber()][string.lower(keys[self.currentKey+1])]) + self.newSet = {} +end +local controlreleased = function(self, set, action, key) + if self.inProgress then + if self.currentKey > 0 and self.currentKey < 7 then + table.insert(self.newSet, key) + dimmer:set("currentControl", keys[self.currentKey+1]) + end + -- There is something wrong with this `if` statements... I mean, look at these numbers. + if self.currentKey > 5 then + dimmer:set("visible", false) + self.parent.allowMove = true + self.inProgress = false + table.insert(self.newSet, Controller.getSets()[self.setNumber()].joystick) + print(self.newSet[7]) + Settings.change(self.setNumber(), self.newSet[1], self.newSet[2], self.newSet[3], self.newSet[4], self.newSet[5], self.newSet[6], self.newSet[7]) + else + dimmer:set("previousControl", Controller.sets[self.setNumber()][string.lower(keys[self.currentKey+1])]) + self.currentKey = self.currentKey + 1 + end + end +end + +local a = { + button:new(menu) + :setText("Keyboard 1") + :setPosition(bx,80) + :set("setNumber", function () return 1 end) + :set("isEnabled", isEnabled) + :set("controlreleased", controlreleased) + :set("stopChange", stopChange) + :set("active", startChange) + , + button:new(menu) + :setText("Keyboard 2") + :setPosition(bx,96) + :set("setNumber", function () return 2 end) + :set("isEnabled", isEnabled) + :set("controlreleased", controlreleased) + :set("stopChange", stopChange) + :set("active", startChange) + , + button:new(menu) + :setText("Gamepad 1") + :setPosition(bx,112) + :set("setNumber", function () return 3 end) + :set("isEnabled", isEnabled) + :set("controlreleased", controlreleased) + :set("stopChange", stopChange) + :set("active", startChange) + , + button:new(menu) + :setText("Gamepad 2") + :setPosition(bx,128) + :set("setNumber", function () return 4 end) + :set("isEnabled", isEnabled) + :set("controlreleased", controlreleased) + :set("stopChange", stopChange) + :set("active", startChange) + , + button:new(menu) + :setText("Go back") + :setPosition(bx,144) + :set("active", function (self) + self.parent:open("main") + end) + , + dimmer +} + +return a \ No newline at end of file diff --git a/config/menuselect.lua b/config/menuselect.lua deleted file mode 100644 index 7b9f073..0000000 --- a/config/menuselect.lua +++ /dev/null @@ -1,73 +0,0 @@ -local menu = ... - -local button = require "button" -local selector = require "selector" -local element = require "element" - -local width, height = love.graphics.getWidth()/getScale(), love.graphics.getHeight()/getScale() -local bx = width/2-29 - -local naut_selector = selector:new(menu) -local start_button = button:new(menu) - -return { - naut_selector - :setPosition(width/2,60) - :setMargin(8) - :setSize(32, 32) - :set("list", require "nautslist") - :set("global", false) - :set("icons_i", love.graphics.newImage("assets/portraits.png")) - :set("icons_q", require "nautsicons") - :init() - , - start_button - :setText("Force start") - :setPosition(bx,134) - :set("isEnabled", function () - if #naut_selector:getFullSelection(false) > 1 then - return true - end - return false - end) - :set("active", function (self) - local nauts = naut_selector:getFullSelection(false) - if #nauts > 1 then - changeScene(World:new(MAP, nauts)) - end - end) - , - button:new(menu) - :setText("Go back") - :setPosition(bx,150) - :set("active", function (self) - self.parent:open("menuhost") - end) - , - element:new(menu) - :setPosition(bx, 101) - :set("the_final_countdown", 9) - :set("draw", function (self, scale) - if self.the_final_countdown ~= 9 then - local x,y = self:getPosition() - local countdown = math.max(1, math.ceil(self.the_final_countdown)) - love.graphics.setColor(255, 255, 255, 255) - love.graphics.setFont(Font) - love.graphics.print("Autostart in:", (x-16)*scale, (y+10)*scale, 0, scale, scale) - love.graphics.setFont(Bold) - love.graphics.printf(countdown, (x+40)*scale, (y)*scale, 36, "center", 0, scale, scale) - end - end) - :set("update", function (self, dt) - local total = #naut_selector:getFullSelection(false) - if total > 1 then - self.the_final_countdown = self.the_final_countdown - dt - else - self.the_final_countdown = 9 - end - if self.the_final_countdown < 0 then - start_button:active() - end - end) - , -} \ No newline at end of file diff --git a/config/menusettings.lua b/config/menusettings.lua deleted file mode 100644 index 19f952e..0000000 --- a/config/menusettings.lua +++ /dev/null @@ -1,114 +0,0 @@ -local menu = ... - -local button = require "button" -local selector = require "selector" -local element = require "element" - -local width, height = love.graphics.getWidth()/getRealScale(), love.graphics.getHeight()/getRealScale() -local bx = width/2-29 - -local keys = {"Left", "Right", "Up", "Down", "Attack", "Jump"} - -local dimmer = element:new(menu) - :setPosition(width/2, 15) - :set("visible", false) - :set("currentControl", "Left") -- it actually means control that is being set CURRENTLY - :set("previousControl", "") -- it actually means key that was set as this control PREVIOUSLY - :set("draw", function (self, scale) - if self.visible then - love.graphics.setColor(0, 0, 0, 210) - love.graphics.rectangle("fill",0,0,width*getRealScale(),height*getRealScale()) - love.graphics.setColor(120, 255, 120, 255) - love.graphics.printf("Press new key for: \n> " .. self.currentControl .. " <", (width/2-110)*scale, (height/2-4)*scale, 220, "center", 0, scale, scale) - love.graphics.setColor(120, 120, 120, 255) - love.graphics.printf("Old: " .. self.previousControl .. "", (width/2-110)*scale, (height/2+16)*scale, 220, "center", 0, scale, scale) - love.graphics.setColor(255, 255, 255, 255) - end - end) - --- CHANGER functions -local isEnabled = function (self) - if Controller.getSets()[self.setNumber()] and not self.inProgress then - return true - else - return false - end -end -local startChange = function (self) - dimmer:set("visible", true):set("currentControl", "Left") - self.parent.allowMove = false - self.inProgress = true - self.currentKey = 0 - -- Displaying old key should be done less tricky; REWORK NEEDED - dimmer:set("previousControl", Controller.sets[self.setNumber()][string.lower(keys[self.currentKey+1])]) - self.newSet = {} -end -local controlreleased = function(self, set, action, key) - if self.inProgress then - if self.currentKey > 0 and self.currentKey < 7 then - table.insert(self.newSet, key) - dimmer:set("currentControl", keys[self.currentKey+1]) - end - -- There is something wrong with this `if` statements... I mean, look at these numbers. - if self.currentKey > 5 then - dimmer:set("visible", false) - self.parent.allowMove = true - self.inProgress = false - table.insert(self.newSet, Controller.getSets()[self.setNumber()].joystick) - print(self.newSet[7]) - Settings.change(self.setNumber(), self.newSet[1], self.newSet[2], self.newSet[3], self.newSet[4], self.newSet[5], self.newSet[6], self.newSet[7]) - else - dimmer:set("previousControl", Controller.sets[self.setNumber()][string.lower(keys[self.currentKey+1])]) - self.currentKey = self.currentKey + 1 - end - end -end - -local a = { - button:new(menu) - :setText("Keyboard 1") - :setPosition(bx,80) - :set("setNumber", function () return 1 end) - :set("isEnabled", isEnabled) - :set("controlreleased", controlreleased) - :set("stopChange", stopChange) - :set("active", startChange) - , - button:new(menu) - :setText("Keyboard 2") - :setPosition(bx,96) - :set("setNumber", function () return 2 end) - :set("isEnabled", isEnabled) - :set("controlreleased", controlreleased) - :set("stopChange", stopChange) - :set("active", startChange) - , - button:new(menu) - :setText("Gamepad 1") - :setPosition(bx,112) - :set("setNumber", function () return 3 end) - :set("isEnabled", isEnabled) - :set("controlreleased", controlreleased) - :set("stopChange", stopChange) - :set("active", startChange) - , - button:new(menu) - :setText("Gamepad 2") - :setPosition(bx,128) - :set("setNumber", function () return 4 end) - :set("isEnabled", isEnabled) - :set("controlreleased", controlreleased) - :set("stopChange", stopChange) - :set("active", startChange) - , - button:new(menu) - :setText("Go back") - :setPosition(bx,144) - :set("active", function (self) - self.parent:open("menumain") - end) - , - dimmer -} - -return a \ No newline at end of file -- cgit v1.1 From 54e85dd188af15cd5f3f5e08f5d3e69088a909b1 Mon Sep 17 00:00:00 2001 From: Aki Date: Fri, 7 Apr 2017 03:06:26 +0200 Subject: Moved map configs to config directory --- config/maps/aiguillon.lua | 58 ++++++++++++++++++++++++++++ config/maps/alpha abyss.lua | 75 ++++++++++++++++++++++++++++++++++++ config/maps/default.lua | 47 +++++++++++++++++++++++ config/maps/readme.md | 82 +++++++++++++++++++++++++++++++++++++++ config/maps/ribbit.lua | 46 ++++++++++++++++++++++ config/maps/rill.lua | 73 +++++++++++++++++++++++++++++++++++ config/maps/sorona.lua | 53 ++++++++++++++++++++++++++ config/maps/starstorm.lua | 93 +++++++++++++++++++++++++++++++++++++++++++++ 8 files changed, 527 insertions(+) create mode 100644 config/maps/aiguillon.lua create mode 100644 config/maps/alpha abyss.lua create mode 100644 config/maps/default.lua create mode 100644 config/maps/readme.md create mode 100644 config/maps/ribbit.lua create mode 100644 config/maps/rill.lua create mode 100644 config/maps/sorona.lua create mode 100644 config/maps/starstorm.lua (limited to 'config') diff --git a/config/maps/aiguillon.lua b/config/maps/aiguillon.lua new file mode 100644 index 0000000..40d3928 --- /dev/null +++ b/config/maps/aiguillon.lua @@ -0,0 +1,58 @@ +return { + -- CENTER AND SIZE + name = "aiguillon", + theme = "aiguillon.ogg", + center_x = 0, + center_y = 10, + width = 370, + height = 290, + -- RESPAWN POINTS + respawns = { + {x = 0, y = -80}, + {x = 0, y = -80}, + {x = 0, y = -80}, + {x = 0, y = -80}, + }, + -- GRAPHICS + clouds = false, + background = "assets/backgrounds/aiguillon.png", + platforms = { + { + x = -108, + y = 22, + shape = {1,0, 212,0, 212,12, 206,18, 14,18, 1,12}, + sprite = "assets/platforms/aiguillon-wide.png" + }, + { + x = -46, + y = -19, + shape = {1,0, 87,0, 87,18, 14,18, 1,12}, + sprite = "assets/platforms/aiguillon-middle.png" + }, + { + x = -141, + y = -57, + shape = {1,0, 50,0, 50,18, 5,18, 1,13}, + sprite = "assets/platforms/aiguillon-left-big.png" + }, + { + x = -132, + y = 84, + shape = {1,0, 25,0, 25,18, 1,18}, + sprite = "assets/platforms/aiguillon-left-small.png" + }, + { + x = 77, + y = -57, + shape = {1,0, 50,0, 50,12, 37,18, 1,18}, + sprite = "assets/platforms/aiguillon-right-big.png" + }, + { + x = 103, + y = 84, + shape = {1,0, 25,0, 25,18, 1,18}, + sprite = "assets/platforms/aiguillon-right-small.png" + } + }, + decorations = {} +} diff --git a/config/maps/alpha abyss.lua b/config/maps/alpha abyss.lua new file mode 100644 index 0000000..0dd2c61 --- /dev/null +++ b/config/maps/alpha abyss.lua @@ -0,0 +1,75 @@ +-- The abyss of the alpha. +-- Animations +local animations_small = { + default = { + frames = 20, + repeated = true + } +} +local animations_big = { + default = { + frames = 20, + repeated = true + } +} +for i=1,10 do + local a = love.graphics.newQuad(i*118-118, 0, 118,51, 1180,51) + animations_big.default[i*2-1] = a + animations_big.default[i*2] = a + local a = love.graphics.newQuad(i*60-60, 0, 60,20, 600,20) + animations_small.default[i*2-1] = a + animations_small.default[i*2] = a +end +-- Map data +return { + -- GENERAL + name = "alpha abyss", + theme = "alpha.ogg", + center_x = 0, + center_y = -80, + width = 360, + height = 240, + -- RESPAWN POINTS + respawns = { + {x = -30, y = 0}, + {x = 30, y = 0}, + {x = 0, y = 0}, + {x = -120, y = -50}, + {x = 120, y = -50}, + {x = 0, y = -75} + }, + -- GRAPHICS + clouds = false, + background = "assets/backgrounds/alpha-1.png", + platforms = { + { + x = -60, + y = 0, + shape = {0,0, 117,0, 101,50, 16,50}, + sprite = "assets/platforms/alpha-big.png", + animations = animations_big + }, + { + x = -145, + y = -50, + shape = {0,0, 59,0, 59,19, 0,19}, + sprite = "assets/platforms/alpha-small.png", + animations = animations_small + }, + { + x = 85, + y = -50, + shape = {0,0, 59,0, 59,19, 0,19}, + sprite = "assets/platforms/alpha-small.png", + animations = animations_small + }, + { + x = -30, + y = -80, + shape = {0,0, 59,0, 59,19, 0,19}, + sprite = "assets/platforms/alpha-small.png", + animations = animations_small + } + }, + decorations = {} +} diff --git a/config/maps/default.lua b/config/maps/default.lua new file mode 100644 index 0000000..05b8dc9 --- /dev/null +++ b/config/maps/default.lua @@ -0,0 +1,47 @@ +-- Default map from original roflnauts +return { + -- GENERAL + name = "default", + theme = "default.ogg", + center_x = 0, + center_y = 0, + width = 360, + height = 240, + -- RESPAWN POINTS + respawns = { + {x = -15, y = -80}, + {x = -5, y = -80}, + {x = 5, y = -80}, + {x = 15, y = -80} + }, + -- GRAPHICS + clouds = true, + background = "assets/backgrounds/default.png", + platforms = { + { + x = -91, + y = 0, + shape = {0,1, 180,1, 180,10, 95,76, 86,76, 0,10}, + sprite = "assets/platforms/default-big.png" + }, + { + x = 114, + y = 50, + shape = {0,1, 51,1, 51,18, 0,18}, + sprite = "assets/platforms/default-side.png" + }, + { + x = -166, + y = 50, + shape = {0,1, 51,1, 51,18, 0,18}, + sprite = "assets/platforms/default-side.png" + }, + { + x = -17, + y = -50, + shape = {0,1, 33,1, 33,14, 0,14}, + sprite = "assets/platforms/default-top.png" + } + }, + decorations = {} +} diff --git a/config/maps/readme.md b/config/maps/readme.md new file mode 100644 index 0000000..dc139ad --- /dev/null +++ b/config/maps/readme.md @@ -0,0 +1,82 @@ +# Mapmaking +*Hugs Emo* + +### Name (string) +Name of the map. Should be same as the filename. *I think*. +```lua +name = "default" +``` + +### Center (int) +Coordinates of center of the map. Camera zone and death zone are placed relative to it. +```lua +center_x = 0, +center_y = 0 +``` + +### Size (int) +Width and height of playground. Camera zone and death zone sizes are calculated based on map size. +```lua +width = 360, +height = 240 +``` + +### Respawns (table, int) +Table of possible respawn points. Players will randomly spawn on one of these points. +```lua +respawns = { + {x = -15, y = -80}, + {x = -5, y = -80}, + {x = 5, y = -80}, + {x = 15, y = -80} +} +``` + +### Clouds (bool) +Presence of clouds. Clouds will spawn if set to **true**. +```lua +clouds = true +``` + +### Background (string) +Path to background image in the game structure. It will be used as fixed background. +```lua +background = "assets/background-default.png" +``` + +### Platforms (table, int, string) +Platforms on which player can stand. They will be placed on given coordinates with given sprite and shape. +Shape are points placed relatively to platform's coordinates. Shape points are connected in given order. On top of that last point is connected with first one. +```lua +platforms = { + { + x = -91, + y = 0, + shape = {0,1, 181,1, 181,10, 96,76, 86,76, 0,10}, + sprite = "assets/platform_big.png" + }, + { + x = 114, + y = 50, + shape = {0,1, 52,1, 52,30, 0,30}, + sprite = "assets/platform_small.png" + } +} +``` + +### Decoration (table, int, string) +Decorations are objects in the background which are not fixed but move alongside with foreground objects (platforms, players, clouds). They do not have physical body. +```lua +decorations = { + { + x = -80, + y = 10, + sprite = "assets/decoration_big.png" + }, + { + x = 50, + y = 50, + sprite = "assets/decoration_small.png" + } +} +``` \ No newline at end of file diff --git a/config/maps/ribbit.lua b/config/maps/ribbit.lua new file mode 100644 index 0000000..c3f5c78 --- /dev/null +++ b/config/maps/ribbit.lua @@ -0,0 +1,46 @@ +return { + -- GENERAL + name = "ribbit", + theme = "ribbit.ogg", + center_x = 0, + center_y = 50, + width = 360, + height = 240, + -- RESPAWN POINTS + respawns = { + {x = -15, y = -80}, + {x = -5, y = -80}, + {x = 5, y = -80}, + {x = 15, y = -80} + }, + -- GRAPHICS + clouds = false, + background = "assets/backgrounds/ribbit.png", + platforms = { + { + x = -154, + y = 10, + shape = {1,12, 48,12, 48,32, 1,32}, + sprite = "assets/platforms/ribbit-left.png" + }, + { + x = 67, + y = 7, + shape = {36,14, 83,14, 83,29, 36,29}, + sprite = "assets/platforms/ribbit-right.png" + }, + { + x = -70, + y = -5, + shape = {0,3, 139,3, 134,24, 5,24}, + sprite = "assets/platforms/ribbit-top.png" + }, + { + x = -54, + y = 63, + shape = {0,3, 107,3, 75,44, 32,44}, + sprite = "assets/platforms/ribbit-bottom.png" + } + }, + decorations = {} +} \ No newline at end of file diff --git a/config/maps/rill.lua b/config/maps/rill.lua new file mode 100644 index 0000000..83c02f2 --- /dev/null +++ b/config/maps/rill.lua @@ -0,0 +1,73 @@ +return { + -- CENTER AND SIZE + name = "rill", + theme = "rill.ogg", + center_x = 0, + center_y = 75, + width = 400, + height = 260, + -- RESPAWN POINTS + respawns = { + {x = -135, y = 10}, + {x = -135, y = 10}, + {x = 135, y = 10}, + {x = 135, y = 10} + }, + -- GRAPHICS + clouds = false, + background = "assets/backgrounds/rill.png", + platforms = { + { + x = -151, + y = 25, + shape = {0,0, 55,0, 55,11, 0,11}, + sprite = "assets/platforms/rill-flat-left.png" + }, + { + x = 93, + y = 25, + shape = {0,0, 55,0, 55,11, 0,11}, + sprite = "assets/platforms/rill-flat-right.png" + }, + { + x = -24, + y = 55, + shape = {0,0, 48,0, 47,15, 1,15}, + sprite = "assets/platforms/rill-center.png" + }, + { + x = -112, + y = 80, + shape = {77,30, 17,0, 0,0, 0,7, 77,44}, + sprite = "assets/platforms/rill-slope-left.png" + }, + { + x = 35, + y = 80, + shape = {0,30, 60,0, 77,0, 77,7, 0,44}, + sprite = "assets/platforms/rill-slope-right.png" + } + }, + decorations = { + { + x = 98, + y = -20, + sprite = "assets/decorations/rill-lollipop-big-purple.png" + }, + { + x = 127, + y = 4, + sprite = "assets/decorations/rill-lollipop-small-green.png" + }, + { + x = -152, + y = -20, + sprite = "assets/decorations/rill-lollipop-big-orange.png" + }, + { + x = -121, + y = 4, + sprite = "assets/decorations/rill-lollipop-small-blue.png" + }, + } +} diff --git a/config/maps/sorona.lua b/config/maps/sorona.lua new file mode 100644 index 0000000..8ec4727 --- /dev/null +++ b/config/maps/sorona.lua @@ -0,0 +1,53 @@ +-- Sorona, but with the worms and such. +return { + -- GENERAL + name = "sorona", + theme = "sorona.ogg", + center_x = 0, + center_y = 0, + width = 360, + height = 240, + -- RESPAWN POINTS + respawns = { + {x = -98, y = -70}, + {x = 70, y = -70}, + {x = -30, y = -20}, + {x = -90, y = 40}, + }, + -- GRAPHICS + clouds = false, + background = "assets/backgrounds/sorona.png", + platforms = { + { + x = -60, + y = 0, + shape = {0,1, 59,1, 59,17, 0,17}, + sprite = "assets/platforms/sorona-center.png" + }, + { + x = -40, + y = 55, + shape = {3,0, 180,0, 180,20, 3,20}, + sprite = "assets/platforms/sorona-right-bottom.png" + }, + { + x = -120, + y = 55, + shape = {3,0, 62,0, 62,23, 3,23}, + sprite = "assets/platforms/sorona-left-bottom.png" + }, + { + x = 0, + y = -50, + shape = {1,1, 140,1, 1,17, 140,17}, + sprite = "assets/platforms/sorona-right-top.png" + }, + { + x = -150, + y = -55, + shape = {1,9, 106,9, 40,27, 1,27}, + sprite = "assets/platforms/sorona-left-top.png" + } + }, + decorations = {} +} diff --git a/config/maps/starstorm.lua b/config/maps/starstorm.lua new file mode 100644 index 0000000..7f00633 --- /dev/null +++ b/config/maps/starstorm.lua @@ -0,0 +1,93 @@ +return { + -- CENTER AND SIZE + name = "starstorm", + theme = "starstorm.ogg", + center_x = 0, + center_y = -20, + width = 400, + height = 260, + -- RESPAWN POINTS + respawns = { + {x = 100, y = 45}, + {x = -100, y = 45}, + {x = -90, y = -25}, + {x = 90, y = -25}, + {x = -110, y = -70}, + {x = 110, y = -70} + }, + -- GRAPHICS + clouds = false, + background = "assets/backgrounds/starstorm.png", + platforms = { + { + x = -170, + y = -55, + shape = { + {0,1, 33,1, 39,6, 39,21, 31,21, 0,21}, + {40,6, 115,6, 115,14, 40,14} + }, + sprite = "assets/platforms/starstorm-left-top.png" + }, + { + x = -156, + y = -2, + shape = {0,0, 109,0, 109,20, 0,20}, + sprite = "assets/platforms/starstorm-left-middle.png" + }, + { + x = -160, + y = 69, + shape = {0,4, 8,4, 13,1, 102,1, 102,16, 19,16, 0,11}, + sprite = "assets/platforms/starstorm-left-bottom.png" + }, + { + x = 52, + y = -55, + shape = { + {115,1, 82,1, 76,6, 76,21, 84,21, 115,21}, + {75,6, 0,6, 0,14, 75,14} + }, + sprite = "assets/platforms/starstorm-right-top.png" + }, + { + x = 44, + y = -2, + shape = {109,0, 0,0, 0,20, 109,20}, + sprite = "assets/platforms/starstorm-right-middle.png" + }, + { + x = 55, + y = 69, + shape = {102,4, 94,4, 89,1, 0,1, 0,16, 83,16, 102,11}, + sprite = "assets/platforms/starstorm-right-bottom.png" + }, + { + x = -27, + y = 40, + shape = {0,6, 53,6, 53,14, 0,14}, + sprite = "assets/platforms/starstorm-center.png" + } + }, + decorations = { + { + x = -166, + y = -37, + sprite = "assets/decorations/starstorm-left-top.png" + }, + { + x = -163, + y = 19, + sprite = "assets/decorations/starstorm-left-bottom.png" + }, + { + x = 119, + y = -37, + sprite = "assets/decorations/starstorm-right-top.png" + }, + { + x = 52+77, + y = 19, + sprite = "assets/decorations/starstorm-right-bottom.png" + } + } +} -- cgit v1.1 From d1a19fea50aefc9d7fb52568a5bdcfb56d75eccf Mon Sep 17 00:00:00 2001 From: Aki Date: Fri, 7 Apr 2017 03:24:40 +0200 Subject: Moved menu elements to /not/ --- config/menus/credits.lua | 4 ++-- config/menus/host.lua | 4 ++-- config/menus/main.lua | 6 +++--- config/menus/select.lua | 6 +++--- config/menus/settings.lua | 6 +++--- 5 files changed, 13 insertions(+), 13 deletions(-) (limited to 'config') diff --git a/config/menus/credits.lua b/config/menus/credits.lua index 6ba04b3..77cba62 100644 --- a/config/menus/credits.lua +++ b/config/menus/credits.lua @@ -1,7 +1,7 @@ local menu = ... -local button = require "button" -local element = require "element" +local button = require "not.Button" +local element = require "not.Element" local width, height = love.graphics.getWidth()/getRealScale(), love.graphics.getHeight()/getRealScale() local bx = width/2-29 diff --git a/config/menus/host.lua b/config/menus/host.lua index 47aaa5e..8a4887e 100644 --- a/config/menus/host.lua +++ b/config/menus/host.lua @@ -1,7 +1,7 @@ local menu = ... -local button = require "button" -local selector = require "selector" +local button = require "not.Button" +local selector = require "not.Selector" local width, height = love.graphics.getWidth()/getScale(), love.graphics.getHeight()/getScale() local bx = width/2-29 diff --git a/config/menus/main.lua b/config/menus/main.lua index 661299c..236c011 100644 --- a/config/menus/main.lua +++ b/config/menus/main.lua @@ -1,8 +1,8 @@ local menu = ... -local button = require "button" -local header = require "header" -local element = require "element" +local button = require "not.Button" +local header = require "not.Header" +local element = require "not.Element" local width, height = love.graphics.getWidth()/getScale(), love.graphics.getHeight()/getScale() local bx = width/2-29 diff --git a/config/menus/select.lua b/config/menus/select.lua index 452a3bf..e759f40 100644 --- a/config/menus/select.lua +++ b/config/menus/select.lua @@ -1,8 +1,8 @@ local menu = ... -local button = require "button" -local selector = require "selector" -local element = require "element" +local button = require "not.Button" +local selector = require "not.Selector" +local element = require "not.Element" local width, height = love.graphics.getWidth()/getScale(), love.graphics.getHeight()/getScale() local bx = width/2-29 diff --git a/config/menus/settings.lua b/config/menus/settings.lua index bfdfc6e..ae0403d 100644 --- a/config/menus/settings.lua +++ b/config/menus/settings.lua @@ -1,8 +1,8 @@ local menu = ... -local button = require "button" -local selector = require "selector" -local element = require "element" +local button = require "not.Button" +local selector = require "not.Selector" +local element = require "not.Element" local width, height = love.graphics.getWidth()/getRealScale(), love.graphics.getHeight()/getRealScale() local bx = width/2-29 -- cgit v1.1 From 1c3040de93f9d5a164ccb06194eacc28eead0234 Mon Sep 17 00:00:00 2001 From: Aki Date: Fri, 7 Apr 2017 21:05:41 +0200 Subject: Maps and nauts list moved to config Implemented functions to create icons list for them Changed so game uses these functions now --- config/maps.lua | 9 +++++++++ config/menus/host.lua | 7 +++++-- config/menus/select.lua | 7 +++++-- config/nauts.lua | 40 ++++++++++++++++++++++++++++++++++++++++ 4 files changed, 59 insertions(+), 4 deletions(-) create mode 100644 config/maps.lua create mode 100644 config/nauts.lua (limited to 'config') diff --git a/config/maps.lua b/config/maps.lua new file mode 100644 index 0000000..32e89a5 --- /dev/null +++ b/config/maps.lua @@ -0,0 +1,9 @@ +return { + "default", + "rill", + "ribbit", + "starstorm", + "aiguillon", + "sorona", + "alpha abyss" +} diff --git a/config/menus/host.lua b/config/menus/host.lua index 8a4887e..b318a5b 100644 --- a/config/menus/host.lua +++ b/config/menus/host.lua @@ -8,6 +8,9 @@ local bx = width/2-29 local map_selector = selector:new(menu) +require "iconsList" +local icons, maps = getMapsIconsList() + return { map_selector :setPosition(width/2, 40) @@ -15,9 +18,9 @@ return { :setMargin(0) :set("global", true) :set("first", true) - :set("list", require "maplist") + :set("list", maps) :set("icons_i", love.graphics.newImage("assets/maps.png")) - :set("icons_q", require "mapicons") + :set("icons_q", icons) :set("shape", "panorama") :init() , diff --git a/config/menus/select.lua b/config/menus/select.lua index e759f40..804b4eb 100644 --- a/config/menus/select.lua +++ b/config/menus/select.lua @@ -10,15 +10,18 @@ local bx = width/2-29 local naut_selector = selector:new(menu) local start_button = button:new(menu) +require "iconsList" +local nautsIcons, nautsList = getNautsIconsList() + return { naut_selector :setPosition(width/2,60) :setMargin(8) :setSize(32, 32) - :set("list", require "nautslist") + :set("list", nautsList) :set("global", false) :set("icons_i", love.graphics.newImage("assets/portraits.png")) - :set("icons_q", require "nautsicons") + :set("icons_q", nautsIcons) :init() , start_button diff --git a/config/nauts.lua b/config/nauts.lua new file mode 100644 index 0000000..2eea71a --- /dev/null +++ b/config/nauts.lua @@ -0,0 +1,40 @@ +-- List of characters with empty character included +-- icons list is generated from this file +return { + "empty", -- empty + "random", --random + "froggo", -- froggy + "cowboy", -- lonestar + "honic", -- leon + "gelato", -- scoop + "veno", -- gnaw + "lady", -- raelynn + "girl", -- ayla + "megoman", -- clunk + "brainos", -- voltar + "woman", -- coco + "bison", -- skolldir + "bobito", -- yuri + "slugzor", -- derpl + "capone", -- vinnie + "nemo", -- spike + "bug", -- genji + "calamari", -- swiggins + "quack", -- rocco + "scissors", -- ksenia + "link", -- ix + "marine", -- ted + "scooter", -- penny + "phonebooth", -- sentry + "weed", -- skree + "gummybear", -- nibbs + "gramps", -- yoolip + "biker", -- chucho + "vrooom", -- lux + "shutter", -- max + "disco", -- esc rocco + "yarr", -- ted pirate + "blblal", -- blabl zork + "kong", -- ronimo + "rock", -- rock +} -- cgit v1.1 From a03c1125f10fbbad253a0efc4727072fcbd55345 Mon Sep 17 00:00:00 2001 From: Aki Date: Sat, 8 Apr 2017 20:38:45 +0200 Subject: Moved configs from root directory to config directory --- config/animations/effects.lua | 76 +++++++++++++++++++++++++++++++++++++++++++ config/animations/hero.lua | 48 +++++++++++++++++++++++++++ config/sounds.lua | 9 +++++ 3 files changed, 133 insertions(+) create mode 100644 config/animations/effects.lua create mode 100644 config/animations/hero.lua create mode 100644 config/sounds.lua (limited to 'config') diff --git a/config/animations/effects.lua b/config/animations/effects.lua new file mode 100644 index 0000000..dd6d55e --- /dev/null +++ b/config/animations/effects.lua @@ -0,0 +1,76 @@ +-- Animations spritesheet array for `Effect` +-- Size of sprie atlas is 168px x 120px + +-- NAME :POSITION :SIZE :FRAMES +-- jump :x 0 y 0: 24px: 4 +-- doublejump:x 0 y 24: 24px: 4 +-- land :x 0 y 48: 24px: 5 +-- respawn :x 0 y 72: 24px: 7 +-- clash :x 0 y 96: 24px: 6 +-- trail :x104 y 0: 16px: 4 +-- hit :x106 y 18: 16px: 3 + +local quads = { + jump = { + [1] = love.graphics.newQuad( 0, 0, 24,24, 168,120), + [2] = love.graphics.newQuad( 24, 0, 24,24, 168,120), + [3] = love.graphics.newQuad( 48, 0, 24,24, 168,120), + [4] = love.graphics.newQuad( 72, 0, 24,24, 168,120), + frames = 4, + repeated = false + }, + doublejump = { + [1] = love.graphics.newQuad( 0, 24, 24,24, 168,120), + [2] = love.graphics.newQuad( 24, 24, 24,24, 168,120), + [3] = love.graphics.newQuad( 48, 24, 24,24, 168,120), + [4] = love.graphics.newQuad( 72, 24, 24,24, 168,120), + frames = 4, + repeated = false + }, + land = { + [1] = love.graphics.newQuad( 0, 48, 24,24, 168,120), + [2] = love.graphics.newQuad( 24, 48, 24,24, 168,120), + [3] = love.graphics.newQuad( 48, 48, 24,24, 168,120), + [4] = love.graphics.newQuad( 72, 48, 24,24, 168,120), + [5] = love.graphics.newQuad( 96, 48, 24,24, 168,120), + frames = 5, + repeated = false + }, + respawn = { + [1] = love.graphics.newQuad( 0, 72, 24,24, 168,120), + [2] = love.graphics.newQuad( 24, 72, 24,24, 168,120), + [3] = love.graphics.newQuad( 48, 72, 24,24, 168,120), + [4] = love.graphics.newQuad( 72, 72, 24,24, 168,120), + [5] = love.graphics.newQuad( 96, 72, 24,24, 168,120), + [6] = love.graphics.newQuad(120, 72, 24,24, 168,120), + [7] = love.graphics.newQuad(144, 72, 24,24, 168,120), + frames = 7, + repeated = false + }, + clash = { + [1] = love.graphics.newQuad( 0, 96, 24,24, 168,120), + [2] = love.graphics.newQuad( 24, 96, 24,24, 168,120), + [3] = love.graphics.newQuad( 48, 96, 24,24, 168,120), + [4] = love.graphics.newQuad( 72, 96, 24,24, 168,120), + [5] = love.graphics.newQuad( 96, 96, 24,24, 168,120), + [6] = love.graphics.newQuad(120, 96, 24,24, 168,120), + frames = 6, + repeated = false + }, + trail = { + [1] = love.graphics.newQuad(104, 0, 16,16, 168,120), + [2] = love.graphics.newQuad(120, 0, 16,16, 168,120), + [3] = love.graphics.newQuad(136, 0, 16,16, 168,120), + [4] = love.graphics.newQuad(152, 0, 16,16, 168,120), + frames = 4, + repeated = false + }, + hit = { + [1] = love.graphics.newQuad(106, 18, 16,16, 168,120), + [2] = love.graphics.newQuad(122, 18, 16,16, 168,120), + [3] = love.graphics.newQuad(138, 18, 16,16, 168,120), + frames = 3, + repeated = false + } +} +return quads \ No newline at end of file diff --git a/config/animations/hero.lua b/config/animations/hero.lua new file mode 100644 index 0000000..881da49 --- /dev/null +++ b/config/animations/hero.lua @@ -0,0 +1,48 @@ +-- Animations spritesheet array for `Player` +-- Basic spritesheet size is 376x26. Each frame is 24x24 and has 1px border around it. +-- From the left: default (walk0), walk1, walk2, walk3, attack0, attack1, attack3, attack_up0, attack_up1, attack_up2, attack_down0, attack_down1, attack_down2, damage0, damage1 +local animations = { + default = { + [1] = love.graphics.newQuad( 1, 1, 24,24, 376,26), + frames = 1, + repeated = true + }, + walk = { + [1] = love.graphics.newQuad( 1, 1, 24,24, 376,26), + [2] = love.graphics.newQuad( 26, 1, 24,24, 376,26), + [3] = love.graphics.newQuad( 51, 1, 24,24, 376,26), + [4] = love.graphics.newQuad( 76, 1, 24,24, 376,26), + frames = 4, + repeated = true + }, + attack = { + [1] = love.graphics.newQuad(101, 1, 24,24, 376,26), + [2] = love.graphics.newQuad(126, 1, 24,24, 376,26), + [3] = love.graphics.newQuad(151, 1, 24,24, 376,26), + frames = 3, + repeated = false + }, + attack_up = { + [1] = love.graphics.newQuad(176, 1, 24,24, 376,26), + [2] = love.graphics.newQuad(201, 1, 24,24, 376,26), + [3] = love.graphics.newQuad(226, 1, 24,24, 376,26), + frames = 3, + repeated = false + }, + attack_down = { + [1] = love.graphics.newQuad(251, 1, 24,24, 376,26), + [2] = love.graphics.newQuad(276, 1, 24,24, 376,26), + [3] = love.graphics.newQuad(301, 1, 24,24, 376,26), + frames = 3, + repeated = false + }, + damage = { + [1] = love.graphics.newQuad(326, 1, 24,24, 376,26), + [2] = love.graphics.newQuad(351, 1, 24,24, 376,26), + [3] = love.graphics.newQuad(326, 1, 24,24, 376,26), + [4] = love.graphics.newQuad(351, 1, 24,24, 376,26), + frames = 4, + repeated = false + }, +} +return animations \ No newline at end of file diff --git a/config/sounds.lua b/config/sounds.lua new file mode 100644 index 0000000..c30af16 --- /dev/null +++ b/config/sounds.lua @@ -0,0 +1,9 @@ +return { + love.sound.newSoundData("assets/sounds/death.ogg"), + love.sound.newSoundData("assets/sounds/hit.ogg"), + love.sound.newSoundData("assets/sounds/step.ogg"), + love.sound.newSoundData("assets/sounds/attack.ogg"), + love.sound.newSoundData("assets/sounds/cheer.ogg"), + love.sound.newSoundData("assets/sounds/jump.ogg"), + love.sound.newSoundData("assets/sounds/spawn.ogg"), +} \ No newline at end of file -- cgit v1.1