More Animation Frames when needed then supplied?

For questions about using Classic.

Post » Thu Jan 13, 2011 10:37 pm

I'm loading external graphics so my game can be moddable. So that means each image has to go into a animation frame for the sprite. Now instead of have 100 frames when I might only need 10, is there a way to add a frame while the game is running, so memory is saved?
Follow me on Twitter @evgLabs
B
33
S
14
G
4
Posts: 251
Reputation: 4,049

Post » Fri Jan 14, 2011 9:00 am

[quote="YetAnotherSuperhero":2unxdxme]I'm loading external graphics so my game can be moddable. So that means each image has to go into a animation frame for the sprite. Now instead of have 100 frames when I might only need 10, is there a way to add a frame while the game is running, so memory is saved?[/quote:2unxdxme]

I do believe there's no way to add new animation frames at runtime. So you might need to become very creative in order to include moddable animations. Or just force a frame count restriction on the user.
B
21
S
6
G
10
Posts: 1,024
Reputation: 7,445

Post » Sat Jan 15, 2011 1:44 am

Just include the maximum amount of frames, allow the user to put in however many frames they want, then specify the start and end frames. Then just control the flow of the animation through private variables.
B
2
S
1
G
1
Posts: 38
Reputation: 676

Post » Sun Jan 16, 2011 10:36 pm

You could use the Tiled Background object with a power of two texture. Then just draw each frame in that texture like a sprite sheet. Then using a list of all the offsets and height/widths of each frame you could do arbitrary length animations.

Here's a proof of concept using Ken from Street Fighter 2:
[url:3jedqd0s]http://dl.dropbox.com/u/5426011/examples3/ken.cap[/url:3jedqd0s] made in 0.99.96

This is where I got the sprite sheet:
[url:3jedqd0s]http://s464.photobucket.com/albums/rr5/JayofThr33/Sprite%20Sheets/?action=view&current=Ken.gif&newest=1[/url:3jedqd0s]

and I used Sprite Vortex to assist the creation of the animations:
[url:3jedqd0s]http://spritevortex.codeplex.com/releases/view/57003[/url:3jedqd0s]

I didn't want to use the xml format spritevortex exported so I converted the data to simple lines of text.
B
79
S
24
G
54
Posts: 4,743
Reputation: 40,749

Post » Thu Feb 03, 2011 1:29 am

Hey H0J0hound! Just saw this post! I'm glad Sprite Vortex was useful to you. If you have any suggestion to make it better just let me know :)
B
58
S
13
G
10
Posts: 632
Reputation: 12,505


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 4 guests