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.

AppGameKit Classic Chat / Animated Sprites

Author
Message
Kevin Cross
21
Years of Service
User Offline
Joined: 15th Nov 2003
Location: London, UK
Posted: 21st Sep 2011 23:19
Hi

Is there a limit to the number of frames AppGameKit can work with? I've got two animated sprites at the moment, with 15 frames each but the second won't work with all 15 frames. It's crashes until I comment out any 5 of the frames. It's not a problem with the files as like I say it works when I comment out any 5. I can cut down the sprite to use less frames if there is a limit but just wanted to check if it's a bug or as expected. If 25 frames is the maximum allowed across multiple sprites than that kind of limits the number of animated sprites you can have.

Here's my code



the12thplaya
Rich Dersheimer
AGK Developer
15
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 21st Sep 2011 23:37
Well, the obvious suggestion is to combine the images into a sprite sheet and use AGK's SetSpriteAnimation() command to set up the frames.

But that won't do anything about a possible bug. The problem may be related to this bug.

Kevin Cross
21
Years of Service
User Offline
Joined: 15th Nov 2003
Location: London, UK
Posted: 21st Sep 2011 23:44 Edited at: 21st Sep 2011 23:49
I've just thought myself that it might be related to the number of sprites that are using these 30 frame animations, there's at least 40. I can probably cut down the number of sprites using these animations to about 20-25.

I've not used a spritesheet before so will look into it to see if that makes a difference. And I'll look to see if the number of lines is causing a problem.

I'm constantly finding AppGameKit crashing until I comment out a line, type some extra lines below it, uncomment the original line and then delete the extra lines. Alot of the crashes just seem random!

the12thplaya
Rich Dersheimer
AGK Developer
15
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 22nd Sep 2011 00:00
A sprite sheet will help a lot, but you could also put the create and load commands in loops instead of calling each one by itself.

Something like



Kevin Cross
21
Years of Service
User Offline
Joined: 15th Nov 2003
Location: London, UK
Posted: 22nd Sep 2011 00:07
Thanks for the code. I was going to look at that too but you saved me writing it After reading through your thread I commented out some more of the frames and then added in 40 print("a") lines and that crashed so my problem is the number of commands/lines that's the problem and not the animations.

I'm constantly re-writing my code to get it working with less lines but will have another look through to see what I can reduce until the bug has been fixed.

the12thplaya
halley
13
Years of Service
User Offline
Joined: 27th Apr 2011
Location: China
Posted: 23rd Sep 2011 08:23
I think you can use the Image utility to make related Images to one image.It's convenient.

give my best

Login to post a reply

Server time is: 2024-11-22 05:32:08
Your offset time is: 2024-11-22 05:32:08