Animations in Love.

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
User avatar
Garb
Prole
Posts: 29
Joined: Fri Aug 05, 2011 8:47 pm

Animations in Love.

Post by Garb » Wed Nov 30, 2011 12:37 am

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:

User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Animations in Love.

Post by Robin » Wed Nov 30, 2011 8:32 am

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?
Help us help you: attach a .love.

User avatar
Garb
Prole
Posts: 29
Joined: Fri Aug 05, 2011 8:47 pm

Re: Animations in Love.

Post by Garb » Wed Nov 30, 2011 11:55 am

I would love to get some sort of sprite-sheet tutorial for animation in love if anyone has a good one.

User avatar
thelinx
The Strongest
Posts: 847
Joined: Fri Sep 26, 2008 3:56 pm
Location: Sweden

Re: Animations in Love.

Post by thelinx » Wed Nov 30, 2011 1:22 pm

Here's something I made for someone in IRC a while back. It might help.
Attachments
animation.love
(5.91 KiB) Downloaded 26183 times

User avatar
Ellohir
Party member
Posts: 235
Joined: Sat Oct 22, 2011 11:12 pm

Re: Animations in Love.

Post by Ellohir » Wed Nov 30, 2011 4:57 pm

What a bummer expecting an animation and seeing a static blank square :cry: #PO2problems #firstWorldProblems

User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: Animations in Love.

Post by bartbes » Wed Nov 30, 2011 4:59 pm

But an animated blank square!

User avatar
Garb
Prole
Posts: 29
Joined: Fri Aug 05, 2011 8:47 pm

Re: Animations in Love.

Post by Garb » Wed Nov 30, 2011 8:00 pm

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:

User avatar
Kazagha
Prole
Posts: 40
Joined: Tue Oct 04, 2011 7:05 am

Re: Animations in Love.

Post by Kazagha » Thu Dec 01, 2011 3:21 am

I have been wondering how to do a timer of sorts (and animation), very cool.

-Kazagha

User avatar
rhezalouis
Party member
Posts: 100
Joined: Mon Dec 07, 2009 10:27 am
Location: Indonesia
Contact:

[Response]Bartbes's AnimationLibrary Usage Sample

Post by rhezalouis » Thu Dec 01, 2011 5:35 pm

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 635 times
And one with a bit more twist:
Garb-Animation2.love
LÖVE0.7.2
(6.32 KiB) Downloaded 451 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).
Aargh, I am wasting my posts! My citizenshiiiip... :o

User avatar
BEANSFTW
Prole
Posts: 28
Joined: Sun Apr 15, 2012 2:58 pm

Re: Animations in Love.

Post by BEANSFTW » Tue Aug 21, 2012 12:38 am

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?

Post Reply

Who is online

Users browsing this forum: No registered users and 10 guests