Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Can't get GIF animation to work.

Author
Message
gameangel147
7
Years of Service
User Offline
Joined: 2nd Dec 2012
Location:
Posted: 29th Jul 2013 06:33
I have been trying to get a simple, two-frame GIF animation to work, but have had no luck.





I have tried placing the commands outside of a repeat loop, and since GIF was listed in the help file for the LOAD ANIMATION command, I tried converting it to an AVI and an MPG and it still hasn't worked. I have been able to manipulate sprites, but never anything animated, and any help would be appreciated.

Also if anyone knows any good and free GIF converters to convert them into AVI's or MPG's, that would be great.

Thanks!
Derek Darkly
8
Years of Service
User Offline
Joined: 22nd Sep 2011
Location: Whats Our Vector, Victor?
Posted: 29th Jul 2013 07:47
Does this work?



D.D.
gameangel147
7
Years of Service
User Offline
Joined: 2nd Dec 2012
Location:
Posted: 29th Jul 2013 09:23
Yes, thanks for that, and I figured out the problem, it's the SYNC command. I turned off SYNC and the animation plays okay. Though the animation is a running animation for the player character so how can I get add controls to the animation, as well as collision with other sprites.

I have always used SYNC, though I have always been a bit confused as to what is does, and so I just turn it on, set the rate to 40 and put in a SYNC at the end of a REPEAT loop.
TheComet
12
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 30th Jul 2013 20:13 Edited at: 30th Jul 2013 20:14
Your problem is that you're re-starting the animation repeatedly. I think this would fix the problem:



@ Derek Darkly

Never use absolute paths in your games, or you'll be the only person able to play them.



Use relative paths instead, they're relative to your executable:



TheComet

gameangel147
7
Years of Service
User Offline
Joined: 2nd Dec 2012
Location:
Posted: 1st Aug 2013 01:53
@TheComet

Thanks, I already had it working, this is my new code.



The reason the SYNC commands are commented is because the animation only plays when SYNC is off, and as soon as it's back on, the animation isn't visible.

I am trying to add controls and collision to the animation, because it is a running animation for the player character, so it will need to move back and forth, jump and collide with platforms. The code I have move the animation, but it stops playing while it moves.

Again thanks for the help!

Login to post a reply

Server time is: 2020-08-04 06:55:27
Your offset time is: 2020-08-04 06:55:27