From a84efca2130f2eca429dd8495992f501f4d373d5 Mon Sep 17 00:00:00 2001 From: Vodkannelle Date: Mon, 10 May 2021 21:33:42 +0200 Subject: [PATCH] stub of linearallax --- linearallax.lua | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 linearallax.lua diff --git a/linearallax.lua b/linearallax.lua new file mode 100644 index 0000000..66f60e0 --- /dev/null +++ b/linearallax.lua @@ -0,0 +1,28 @@ +-- Chuchu by Makaron +-- linearallax = Linear Parallax +-- Takes a mirrored sprite and quickly simulate a parallax moving linearly +-- indefinitely + +local Linearallax = {} + +function Linearallax.new(planX, planY, img, imgMirrored, speed) + obj = { + planX = 512, + planY = 512, + img = nil, + imgMir = nil, + speed = 1 + } + + if planX then obj.planX = planX end + if planY then obj.planY = planY end + if img then obj.img = img end + if imgMirrored then obj.imgMir = imgMirrored end + if speed ~ + + return setmetatable(obj, { + __index = Linearallax + }) +end + +function Linearallax:update(dt)