## Animations in Love.

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Garb
Prole
Posts: 29
Joined: Fri Aug 05, 2011 8:47 pm

### Animations in Love.

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!

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

### Re: Animations in Love.

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?

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

### Re: Animations in Love.

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

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

### Re: Animations in Love.

Here's something I made for someone in IRC a while back. It might help.
Attachments
animation.love

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

### Re: Animations in Love.

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

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

### Re: Animations in Love.

But an animated blank square!

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

### Re: Animations in Love.

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.

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

### Re: Animations in Love.

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

-Kazagha

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

### [Response]Bartbes's AnimationLibrary Usage Sample

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
And one with a bit more twist:
Garb-Animation2.love
LÖVE0.7.2

Note: sprites are borrowed from Advance Wars (Copyright belongs to Intelligent Systems I suppose).
Aargh, I am wasting my posts! My citizenshiiiip...

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

### Re: Animations in Love.

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?

### Who is online

Users browsing this forum: Google [Bot] and 4 guests