AnAl Animation in side-scrolling game

General discussion about LÖVE, Lua, game development, puns, and unicorns.
User avatar
Deluxo
Prole
Posts: 6
Joined: Tue Jul 20, 2010 2:33 pm

AnAl Animation in side-scrolling game

Post by Deluxo »

Hello. Im new to lua and love2d.

Things gets tricky when i need to play specific sequence of animation on key events.

function love.update(dt)
anim:update(dt)
world:update(dt)

if love.keyboard.isDown("d") then
bodies[1]:applyForce(800, 0)
anim:play() <---- i need to play specific frames and loop them. is it possible? if no, maybe somebody could recommend different way to play animation when character moves.
Thanks in advance!
User avatar
nevon
Commander of the Circuloids
Posts: 938
Joined: Thu Feb 14, 2008 8:25 pm
Location: Stockholm, Sweden
Contact:

Re: AnAl Animation in side-scrolling game

Post by nevon »

Give your entity a state, and then play an animation depending on the state of your entity. So you could have a walking state, a standing state, a jumping state, etc. and then play the corresponding animation.

See my attached file for an example.
Attachments
walkanimation.love
(345.49 KiB) Downloaded 252 times
User avatar
Deluxo
Prole
Posts: 6
Joined: Tue Jul 20, 2010 2:33 pm

Re: AnAl Animation in side-scrolling game

Post by Deluxo »

Guess I will need to make avatar OBEY too...

Thanks man! I thought forums are quite dead. Btw does somebody know whats going on with Love lately?
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: AnAl Animation in side-scrolling game

Post by Robin »

Deluxo wrote:Btw does somebody know whats going on with Love lately?
A lot is going on. There have been some changes in the dev team, LÖVE 0.7.0 will probably be released before the end of next century, and the community is as active as ever. ;)
Help us help you: attach a .love.
User avatar
Deluxo
Prole
Posts: 6
Joined: Tue Jul 20, 2010 2:33 pm

Re: AnAl Animation in side-scrolling game

Post by Deluxo »

Well everything you said sounds very sarcastic... Can you confirm what you sir wrote up there?
User avatar
kikito
Inner party member
Posts: 3153
Joined: Sat Oct 03, 2009 5:22 pm
Location: Madrid, Spain
Contact:

Re: AnAl Animation in side-scrolling game

Post by kikito »

I confirm that the community is active. I've poked it, it was active.

A bit more seriously (but not too much): It is possible to follow the development in quasi-realtime by going to its bitbucket page. You can even subscribe to its atom feed, if you are into that kind of thing.

It seems that development has slowed down a bit during last 2 months or so - I'm guessing due to exams and summer holidays.

You may notice that the 0.7.0 section has been in the changelog for a month already. In theory it should not take much longer to have a new version.
When I write def I mean function.
User avatar
Luiji
Party member
Posts: 396
Joined: Mon May 17, 2010 6:59 pm

Re: AnAl Animation in side-scrolling game

Post by Luiji »

Since it seems this topic has been resolved, I'm going to go a bit off-topic for a moment.

Are there any of us that don't go to school (whether K-12 or college)?
Good bye.
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: AnAl Animation in side-scrolling game

Post by bartbes »

What the hell? Don't answer that!
User avatar
Luiji
Party member
Posts: 396
Joined: Mon May 17, 2010 6:59 pm

Re: AnAl Animation in side-scrolling game

Post by Luiji »

Ahem, I'm not asking for ages, I'm just asking if anybody's actually gotten to the point in which they're past college.

If not, it would really explain a lot about the immaturity I sometimes find here.
Good bye.
User avatar
zer0wolf
Prole
Posts: 6
Joined: Fri Sep 11, 2009 4:23 pm
Location: Austin, TX
Contact:

Re: AnAl Animation in side-scrolling game

Post by zer0wolf »

I graduated from college three years ago and I like making Love :) Admittedly, I'm not very experienced ;)
Post Reply

Who is online

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