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 --- animations.lua | 48 --------------------------- config/animations/effects.lua | 76 +++++++++++++++++++++++++++++++++++++++++++ config/animations/hero.lua | 48 +++++++++++++++++++++++++++ config/sounds.lua | 9 +++++ effects.lua | 76 ------------------------------------------- not/Effect.lua | 2 +- not/Hero.lua | 4 +-- sounds.lua | 9 ----- 8 files changed, 136 insertions(+), 136 deletions(-) delete mode 100644 animations.lua create mode 100644 config/animations/effects.lua create mode 100644 config/animations/hero.lua create mode 100644 config/sounds.lua delete mode 100644 effects.lua delete mode 100644 sounds.lua diff --git a/animations.lua b/animations.lua deleted file mode 100644 index 881da49..0000000 --- a/animations.lua +++ /dev/null @@ -1,48 +0,0 @@ --- 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/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 diff --git a/effects.lua b/effects.lua deleted file mode 100644 index dd6d55e..0000000 --- a/effects.lua +++ /dev/null @@ -1,76 +0,0 @@ --- 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/not/Effect.lua b/not/Effect.lua index 4051b92..dd7570a 100644 --- a/not/Effect.lua +++ b/not/Effect.lua @@ -24,7 +24,7 @@ end -- Initializer of `Effect`. function Effect:init (name, x, y) Decoration.init(self, x, y, nil) - self:setAnimationsList(require("effects")) + self:setAnimationsList(require("config.animations.effects")) self:setAnimation(name) end diff --git a/not/Hero.lua b/not/Hero.lua index 4150024..feb61da 100644 --- a/not/Hero.lua +++ b/not/Hero.lua @@ -28,7 +28,7 @@ Hero = { portrait_frame = nil, portrait_sheet = getNautsIconsList(), portrait_box = love.graphics.newQuad( 0, 15, 32,32, 80,130), - sfx = require "sounds", + sfx = require "config.sounds", } -- `Hero` is a child of `PhysicalBody`. @@ -68,7 +68,7 @@ function Hero:init (name, world, x, y) self.world = world self.punchCooldown = 0 self.name = name - self:setAnimationsList(require("animations")) + self:setAnimationsList(require("config.animations.hero")) self:createEffect("respawn") end diff --git a/sounds.lua b/sounds.lua deleted file mode 100644 index c30af16..0000000 --- a/sounds.lua +++ /dev/null @@ -1,9 +0,0 @@ -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