Load from url (whole animation instead frames)

Get help using Construct 2

Post » Fri Apr 12, 2013 7:07 pm

Hi guys!

Once more I need your help. :)

I am sharing my cap so you can have a better idea of what I need.
https://dl.dropboxusercontent.com/u/83579758/TestWeapon.capx

In order you see what is going on, please run the cap and press 1.

Everytime you press 1, the player will get a new weapon and make an attack.

My problem is: everytime we press 1, instead I load a full new animation, lets say a whole image, I am loading frame by frame.

Is ther anyway to to load the whole image or any other better method?

Once my game gets bigger I should have more than 100 weapons and lots of other gear, I guess loading like this will generate some lag or even maybe bugs.

Thanks alot!

B
8
Posts: 24
Reputation: 985

Post » Fri Apr 12, 2013 9:05 pm

Same problem here...
B
1
Posts: 2
Reputation: 254

Post » Sun Apr 14, 2013 1:58 am

Kept reading, trying and doing searches but I could not find anything about it. Anybody has any idea?

Please helppppp me!!!

Thanks :)
B
8
Posts: 24
Reputation: 985

Post » Mon Apr 15, 2013 1:41 pm

You should not load entire animations like that. Why not just add the images to the object's animations?
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,528

Post » Mon Apr 15, 2013 2:46 pm

I could do that, yes, but my concern is:

Lets say I create only one sword and inside it I create all the animations I need with all diferent swords. Now, if I have like 500 swords + all animations for each sword, will not be this "impossible" to load this game?

Or once I hit the game url the html5 will only load the animations/images used in this very fight? I mean, 500 swords, but player only use sword 1 and 2, will the game load the other 498 even when they are not used?

Thank you very much for your reply Ashley!!!
B
8
Posts: 24
Reputation: 985

Post » Mon Apr 15, 2013 6:22 pm

@olivete if such a scenario is actually necessary (500 swords!?) I'd recommend using Spriter for the animations and loading the sword image from a URL.
Moderator
B
72
S
13
G
11
Posts: 900
Reputation: 11,783

Post » Mon Apr 15, 2013 6:55 pm

thehen, I really dont want to abuse your good will, but would you mind to show me an example or give me more tips about this?

I should not have 500 swords, but I might have like 50 weapons of different types, like 50 axes, 50 swords and so.

I just wish had a way to get this sample I posted and using it make the program load whatever weapon the player should get at that moment.

Thanks alot for your reply!!!!
B
8
Posts: 24
Reputation: 985

Post » Mon Apr 15, 2013 7:05 pm

I think it's extremely unlikely you'll really have 500 swords. That's a totally ridiculous number! Even if you did, your sword graphic is pretty small. 500 sprites at 37x11 (be sure to crop them all) is less than one megabyte decompressed, and well under that compressed. So it probably won't be a problem even if you made 2000 swords. Construct can handle that just fine with the images in the project itself. Don't come up with complicated optimisations if there's no need - it's a waste of time.
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,528

Post » Mon Apr 15, 2013 7:19 pm

I probably did not make myselft that clear.

The way I am doing it (might not be the best one) is get my char and above its graphic layer I put a item, lets say the sword or maybe a helm.

For each moviment my char makes (and it will use an 128x128 pixel area) it will be carrying his equipments, for example, a sword and helm.

The problem is that for each moviment my char makes the sword/helm will have a different animation, so I really doubt that only 10 swords/helms will be smaller than 500kb using all these poses.

The final detail I will drop about this is this game will be like a replay thing. We want to a system creates a fight and the C2 show this fight to the player, and of course, each fight players will have different equipments.

Is there a better way to do that? Sorry I am too recent here and I still learning/searching.

Thanks!!!olivete2013-04-15 19:19:52
B
8
Posts: 24
Reputation: 985

Post » Mon Apr 15, 2013 8:00 pm

@olivete definitely check out Spriter http://www.scirra.com/forum/spriter-c2-plugin-update-update-on-3-29-13_topic59694.html. It lets you have a single animation and to swap out sprites easily (so you could swap out different helmets, armor, swords etc).

Then, as Ashley said, you can probably just have a load of small sprites for the weapons.
Moderator
B
72
S
13
G
11
Posts: 900
Reputation: 11,783

Next

Return to How do I....?

Who is online

Users browsing this forum: austinblackbelt and 34 guests