summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--config/animations/flames.lua21
-rw-r--r--not/Trap.lua24
2 files changed, 22 insertions, 23 deletions
diff --git a/config/animations/flames.lua b/config/animations/flames.lua
new file mode 100644
index 0000000..62ecbb1
--- /dev/null
+++ b/config/animations/flames.lua
@@ -0,0 +1,21 @@
+return
+{
+ default = {
+ [1] = love.graphics.newQuad(0, 0, 42, 19, 168, 19),
+ [2] = love.graphics.newQuad(42, 0, 42, 19, 168, 19),
+ frames = 2,
+ repeated = true
+ },
+ fadein = {
+ [1] = love.graphics.newQuad(84, 0, 42, 19, 168, 19),
+ [2] = love.graphics.newQuad(126, 0, 42, 19, 168, 19),
+ frames = 2,
+ repeated = false
+ },
+ fadeout = {
+ [1] = love.graphics.newQuad(126, 0, 42, 19, 168, 19),
+ [2] = love.graphics.newQuad(84, 0, 42, 19, 168, 19),
+ frames = 2,
+ repeated = false
+ }
+}
diff --git a/not/Trap.lua b/not/Trap.lua
index 84de5b0..47c3f09 100644
--- a/not/Trap.lua
+++ b/not/Trap.lua
@@ -1,30 +1,8 @@
Trap = require "not.PhysicalBody":extends()
--- TODO: Move flames' animations to config file.
-local animations = {
- default = {
- [1] = love.graphics.newQuad(0, 0, 42, 19, 168, 19),
- [2] = love.graphics.newQuad(42, 0, 42, 19, 168, 19),
- frames = 2,
- repeated = true
- },
- fadein = {
- [1] = love.graphics.newQuad(84, 0, 42, 19, 168, 19),
- [2] = love.graphics.newQuad(126, 0, 42, 19, 168, 19),
- frames = 2,
- repeated = false
- },
- fadeout = {
- [1] = love.graphics.newQuad(126, 0, 42, 19, 168, 19),
- [2] = love.graphics.newQuad(84, 0, 42, 19, 168, 19),
- frames = 2,
- repeated = false
- }
-}
-
function Trap:new (direction, x, y, world, imagePath)
Trap.__super.new(self, x, y, world, imagePath)
- self:setAnimationsList(animations)
+ self:setAnimationsList(require("config.animations.flames"))
self:setBodyType("static")
local mirror = 1