Page 1 of 2

Animations in Love.

Posted: Wed Nov 30, 2011 12:37 am
by Garb
So, I am trying to create a simple game with love, I would like to include animations in this game, unfortunately, the tutorial on the wiki for AnAl does not seem to want to work for me.

I am not exactly sure how to get animations working in Love, does anyone have any sort of detailed resources or examples I could utilize? I would love you forever if you were able to help me, thanks! :awesome:

Re: Animations in Love.

Posted: Wed Nov 30, 2011 8:32 am
by Robin
To animate something in LÖVE, you can either use a lot of images, one for each frame, or a single picture, which has all the frames next to each other.

You can use Quads to pick one portion of the image at the time and draw it.

Those are the basics. What sort of resources would you like to see? Tutorials, or animations used in actual games?

Re: Animations in Love.

Posted: Wed Nov 30, 2011 11:55 am
by Garb
I would love to get some sort of sprite-sheet tutorial for animation in love if anyone has a good one.

Re: Animations in Love.

Posted: Wed Nov 30, 2011 1:22 pm
by thelinx
Here's something I made for someone in IRC a while back. It might help.

Re: Animations in Love.

Posted: Wed Nov 30, 2011 4:57 pm
by Ellohir
What a bummer expecting an animation and seeing a static blank square :cry: #PO2problems #firstWorldProblems

Re: Animations in Love.

Posted: Wed Nov 30, 2011 4:59 pm
by bartbes
But an animated blank square!

Re: Animations in Love.

Posted: Wed Nov 30, 2011 8:00 pm
by Garb
thelinx wrote:Here's something I made for someone in IRC a while back. It might help.
Thanks bro, this is going to help some much.

You are on my imaginary list of totally awesome people. :awesome:

Re: Animations in Love.

Posted: Thu Dec 01, 2011 3:21 am
by Kazagha
I have been wondering how to do a timer of sorts (and animation), very cool.

-Kazagha

[Response]Bartbes's AnimationLibrary Usage Sample

Posted: Thu Dec 01, 2011 5:35 pm
by rhezalouis
Hi Garb,

You could take a look at the minimum usage of bartbes's AnimationLibrary (sounds so wrong if typed as is, doesn't it? Guys, please stop making lewd library names; parents would forbid their kids to code on löve .. )
Garb-Animation.love
LÖVE0.7.2
(6.17 KiB) Downloaded 788 times
And one with a bit more twist:
Garb-Animation2.love
LÖVE0.7.2
(6.32 KiB) Downloaded 612 times
I hope they could help you pick up the library. Enjoy.

Note: sprites are borrowed from Advance Wars (Copyright belongs to Intelligent Systems I suppose).

Re: Animations in Love.

Posted: Tue Aug 21, 2012 12:38 am
by BEANSFTW
I saw the garb animation thing, and coded an animation myself and this is how it looks like.

Code: Select all

function love.load()
	require(anal)
	spritesheet = love.graphics.newImage("animationtest.png")
	spritesheet.setFilter("nearest", "nearest")
	animation = newAnimation(spritesheet, 20, 20, 5, 4)
end

function love.update(dt)
	animation:update(dt)
end

function love.draw
	animation:draw(20, 20, 0, 5)
end
and got this

Code: Select all

Syntax error: main.lua:15:'(' expected near 'animation'

Traceback

[C]: ?
[C]: in function 'require'
[C]: in function 'xpcall'
Whats wrong with my code?