AnAL Animation problems

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.
Post Reply
User avatar
Ranguna259
Party member
Posts: 911
Joined: Tue Jun 18, 2013 10:58 pm
Location: I'm right next to you

AnAL Animation problems

Post by Ranguna259 »

Hello again lovers

I've found out that I can't use löve's physics to code the player so I've decided to re-write player.lua without them.

The problem is that I can't get the animation to play all the frames.

When the rectangle falls to the ground and when you press 'a' or 'd' then the player should move right or left (it does) and it should also play the walking animation, player.anim, which was built with a 3 frame image called 'walking.png' in the lines 31 and 32 but when the animation playes it only shows 1 frame.

I want to know what I am doing wrong with the animation and how to correct it.

Thanks for reading, I've attached a .love file with a main.lua and all the images.

(the animation is loaded in the lines 31 and 32 and it's played in the line 137)
LoveDebug- A library that will help you debug your game with an on-screen fully interactive lua console, you can even do code hotswapping :D

Check out my twitter.
Merlin_ua
Prole
Posts: 4
Joined: Fri Jun 21, 2013 7:34 am

Re: AnAL Animation problems

Post by Merlin_ua »

You need to call "update" for the animation, not just "draw". Currently it never moves on from the first frame. This can be fixed by simply adding:

Code: Select all

player.anim:update(dt)
to the end of your update function.
User avatar
Ranguna259
Party member
Posts: 911
Joined: Tue Jun 18, 2013 10:58 pm
Location: I'm right next to you

Re: AnAL Animation problems

Post by Ranguna259 »

Merlin_ua wrote:You need to call "update" for the animation, not just "draw". Currently it never moves on from the first frame. This can be fixed by simply adding:

Code: Select all

player.anim:update(dt)
to the end of your update function.
Riiight :megagrin:

Totaly forgot about this, thanks Merlin

And welcome to the forum :)
LoveDebug- A library that will help you debug your game with an on-screen fully interactive lua console, you can even do code hotswapping :D

Check out my twitter.
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 152 guests