Katsudö, another animation Library for LÖVE

Showcase your libraries, tools and other projects that help your fellow love users.
Post Reply
User avatar
alberto_lara
Party member
Posts: 372
Joined: Wed Oct 30, 2013 8:59 pm

Katsudö, another animation Library for LÖVE

Post by alberto_lara »

Hi guys, I'm making this small animation library called Katsudö

Here's a demo:

Code: Select all

local k = require "katsudo"

function love.load()
	gr = love.graphics
	gr.setBackgroundColor(1, 1, 1)
	local imgDir = "imgs/tc.png"
	-- 18 frames of 30x55 at 25 FPS:
	tc  = k.new(imgDir, 30, 55, 18, 0.04)
	tc2 = k.new(imgDir, 30, 55, 18, 0.04, "rough")
	tc3 = k.new(imgDir, 30, 55, 18, 0.04):rewind()
	tc4 = k.new(imgDir, 30, 55, 18, 0.04):once()
end

function love.update(dt)
	k.update(dt)
end

function love.draw()
	tc:draw (50,  50, 0, 5, 5)
	tc2:draw(200, 50, 0, 5, 5)
	tc3:draw(350, 50, 0, 5, 5)
	tc4:draw(500, 50, 0, 5, 5)
end
And the result is something like this:

(the last one is played once and then it stops)
Image
katsudo.love
(39.54 KiB) Downloaded 155 times
Here's my repo: https://github.com/tavuntu
Tested just in LÖVE 0.10.1, please let me know your thoughts and thanks!
EDIT: it still works in 0.10.2
EDIT2: it still works in 11.0
Last edited by alberto_lara on Sat Nov 24, 2018 4:44 am, edited 4 times in total.
Connorses
Citizen
Posts: 63
Joined: Fri Sep 06, 2013 7:02 am

Re: Katsudö, another animation Library for LÖVE

Post by Connorses »

The code for this is very readable. I could see myself using it for a game; I could even modify it if I had to. Definitely gonna bookmark it.
User avatar
s-ol
Party member
Posts: 1077
Joined: Mon Sep 15, 2014 7:41 pm
Location: Cologne, Germany
Contact:

Re: Katsudö, another animation Library for LÖVE

Post by s-ol »

Looks cool, one improvement I would propose is to move the API over to the colon syntax and in the process gain some memory performance by not redefining the functions for every instance.

s-ol.nu /blog  -  p.s-ol.be /st8.lua  -  g.s-ol.be /gtglg /curcur

Code: Select all

print( type(love) )
if false then
  baby:hurt(me)
end
User avatar
alberto_lara
Party member
Posts: 372
Joined: Wed Oct 30, 2013 8:59 pm

Re: Katsudö, another animation Library for LÖVE

Post by alberto_lara »

Connorses wrote:The code for this is very readable. I could see myself using it for a game; I could even modify it if I had to. Definitely gonna bookmark it.
I appreciate it. And yes, I tried to make both the API and the internal code as simple/readable as I could, Katsudö is a "port" of the old AnAL.lua library, with the same basic functionality.
Last edited by alberto_lara on Fri May 13, 2016 3:33 pm, edited 1 time in total.
User avatar
alberto_lara
Party member
Posts: 372
Joined: Wed Oct 30, 2013 8:59 pm

Re: Katsudö, another animation Library for LÖVE

Post by alberto_lara »

s-ol wrote:Looks cool, one improvement I would propose is to move the API over to the colon syntax and in the process gain some memory performance by not redefining the functions for every instance.
Done!
User avatar
alberto_lara
Party member
Posts: 372
Joined: Wed Oct 30, 2013 8:59 pm

Re: Katsudö, another animation Library for LÖVE

Post by alberto_lara »

Hi, I've just updated katsudö to version 0.0.1

Repo: https://github.com/tavuntu/katsudo
Changes: Added function setDelay() to have a better control over each frame

EDIT: Post updated
User avatar
alberto_lara
Party member
Posts: 372
Joined: Wed Oct 30, 2013 8:59 pm

Re: Katsudö, another animation Library for LÖVE

Post by alberto_lara »

Hi, just to let you know a new version of Katsudö is out: https://github.com/tavuntu/katsudo (added support for rotating images)
(also, if you're interested, I have some JavaScript projects too!)
Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 49 guests