creating multiple instances of sprite with diff im

Get help using Construct 2

Post » Sun Oct 14, 2012 3:56 am

I am making a game similar to jigsaw puzzle where i need to create puzzle pieces with different images, co-ordinates , etc and put in some form of scrollable selection container/controller.

It doesn't make sense to create static sprite as there a lot of images 100 images x 20 puzzle pieces each = 2000.

Just wondering how to do it to create several dynamic instance of sprite with a different image every time it loads the new puzzle image.
B
16
S
4
Posts: 248
Reputation: 2,267

Post » Sun Oct 14, 2012 5:56 pm

i am thinking of using this plugin anime unique plugin [URL=http://www.scirra.com/forum/pluginunique-spriteno-animuniqe-image-per-inst_topic43116.html[/URL] , but unfortunately it seems to be only avaiable for .csx classic construct, has anyone has ported to .js plugin or any other ideas to implement ? tringio2012-10-14 17:57:14
B
16
S
4
Posts: 248
Reputation: 2,267

Post » Sun Oct 14, 2012 11:41 pm

try putting all the different puzzle pieces into one big animation, and when you create it, you can call the different animation by frame number
B
27
S
9
G
5
Posts: 108
Reputation: 5,744

Post » Tue Oct 16, 2012 7:02 am

I am using ur same suggestion and trying to create 10 objects on start layout event, but it seems to get executed for every tick not just once , not sure what happens, but please help . Here is the CAPX http://dl.dropbox.com/u/80050021/PHTrial.capx
B
16
S
4
Posts: 248
Reputation: 2,267

Post » Tue Oct 16, 2012 5:15 pm

Can i get some help here, i know it might be a silly question, but people like me with little programming experience trying to work out something after all i guess Contruct 2 is created to help people like me :)
B
16
S
4
Posts: 248
Reputation: 2,267

Post » Tue Oct 16, 2012 5:44 pm

Your problem has nothing to do with the creation of the sprite instances!

First, you should give people time to responde - at least a day I would say.
Second, you should try to keep your code clean from random trials of different techniques and plugins not used.

Now, after I managed to get something to show - building effect masks does not realy show something - I could see what's going wrong. You have set your "default" sprite, which you recreate with "system create" to auto start and loop through your different frames going back and forth every 5 frames. This creates the illusion of haveing the "start of layout" code to be executed "every tick"!Weishaupt2012-10-17 07:43:51
B
43
S
20
G
13
Posts: 723
Reputation: 14,635


Return to How do I....?

Who is online

Users browsing this forum: EthanD57, Greaver, luckyrawatlucky, QuantumMMX, SpyDaniel and 9 guests