Problems with the animation

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
ATS
Prole
Posts: 20
Joined: Mon Jun 28, 2021 3:25 am
Location: Brazil
Contact:

Problems with the animation

Post by ATS »

Hello everybody. In my game I'm developing I have my animations system, but yesterday I discovered a problem with it.

I made an executable and sent it to a friend to test, to my surprise, the animations came out MEGA-slow, but on my computer it's normal.

I believe the problem is Delta Time(dt),
I will leave a demo simulating the same problem.

Who can help me, I already leave a big thank you.
Attachments
animation_demo.love
(3.16 KiB) Downloaded 59 times

Code: Select all

-------------------------------
-- i love programming in Lua --
-------------------------------
Andlac028
Party member
Posts: 174
Joined: Fri Dec 14, 2018 2:27 pm
Location: Slovakia

Re: Problems with the animation

Post by Andlac028 »

Firstly, I was unable to see any form of animation.

So I looked at the code. I don't know, why you have 2 tickers... I changed speed to duration and counted ticks in seconds (see code below, but please note, I have done it on mobile)
Attachments
main.lua
(3.16 KiB) Downloaded 51 times
Last edited by Andlac028 on Mon Jun 06, 2022 7:23 pm, edited 1 time in total.
User avatar
ATS
Prole
Posts: 20
Joined: Mon Jun 28, 2021 3:25 am
Location: Brazil
Contact:

Re: Problems with the animation

Post by ATS »

Andlac028 wrote: Mon Jun 06, 2022 6:48 am Firstly, I was unable to see any form of animation.

So I looked at the code. I don't know, why ju have 2 tickers... I changed speed to duration and counted ticks in seconds (see code below, but please note, I have done it on mobile)
THANK YOU SO MUCH!!!
I first tested it on my tablet (because I was busy and unable to use the computer at the moment) and it worked, then I tested it on my machine and it also worked, and finally, I tested it on my friend's computer and to my surprise IT WORKED!!

I'm really grateful for the help,
your name will be in the thanks area of ​​my game :3

And I wanted to understand this ".5", is it like "0.5"?
The first time I saw it I thought it would give an error :crazy:

Code: Select all

-- Creating a new animation...
animation = NewAnim(

        "frames", -- Sprite-Sheet

        {0, 1, 2, 3}, -- Frames (The first frame is number 0)

        .5, -- duration, in seconds

	true -- loop
        
)

Code: Select all

-------------------------------
-- i love programming in Lua --
-------------------------------
Andlac028
Party member
Posts: 174
Joined: Fri Dec 14, 2018 2:27 pm
Location: Slovakia

Re: Problems with the animation

Post by Andlac028 »

You are welcome

Yes, it is just shorthand for 0.5 ;)
Post Reply

Who is online

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