How do I get sprite instances to stay in a different color?

Get help using Construct 2

Post » Tue Oct 14, 2014 3:52 am

I made different animations of a sprite into recolored versions of the object. I'm trying to get them to set to a random one so all the different sprites are different colors. All I can get it to do is flash between all of it though, or stay stuck on just one color for all of them.

I tried duplicating the "Create your own Christmas Game" tutorial game's method, (it's exactly what I'm trying to do but the tutorial doesn't actually go over it,) as well as the "Random Animation" by Weishaupt tutorial, and those both led to flashing.

(it's seriously annoying that newbies can't post links @[email protected] )
You do not have the required permissions to view the files attached to this post.
B
10
Posts: 28
Reputation: 401

Post » Tue Oct 14, 2014 4:15 am

I believe it's because your "anims" variable is never set to anything except 0.

I'm not exactly sure what all is going on here, but if you add the action "add 1 to anims" to that for each loop, does that do what you want?

EDIT: nah, not that. heh.. you just need to set "anims" to the amount of animations you have. (or put that number in place of "anims" in the random thing)
B
86
S
43
G
71
Posts: 601
Reputation: 43,619

Post » Tue Oct 14, 2014 4:51 am

@spacedoubt I put "3" in the random() and that made them all animation 2! so I changed it to 4, and then it started flashing through them rapidly!
B
10
Posts: 28
Reputation: 401

Post » Tue Oct 14, 2014 4:52 am

try changing the for each loop to bug - on created.
B
86
S
43
G
71
Posts: 601
Reputation: 43,619

Post » Tue Oct 14, 2014 4:56 am

@spacedoubt Oh that worked!! But now half of the bugs are upside down when they spawn?
B
10
Posts: 28
Reputation: 401

Post » Tue Oct 14, 2014 5:07 am

You must figure this one out on your own, young jedi. ;)
B
86
S
43
G
71
Posts: 601
Reputation: 43,619

Post » Tue Oct 14, 2014 5:25 am

@spacedoubt ahhg can you give me a hint? ;P I've tried like a million different tweaks
B
10
Posts: 28
Reputation: 401

Post » Tue Oct 14, 2014 6:23 pm

look at your bug animations. look at what you're doing to the bugs immediately after spawning them.
the only ones that are spawning differently (right side up, until you fix it) are the ones that are already placed and have their angle set (and aren't being affected by the command immediately after spawn).

Trying to be helpful here, it seems you're in over your head a bit. I would suggest doing some of the beginner tutorials, at least beginner's guide to C2 (AKA ghost shooter), and the platform one, till you get a better feel for what all is going on.
B
86
S
43
G
71
Posts: 601
Reputation: 43,619

Post » Tue Oct 14, 2014 8:56 pm

@spacedoubt Actually no, those aren't the ones upside down. It's random ones being spawned by the big guys, at random points in the game. I set the bullet set angle to off, and originally before the color they were all upside down aside from those, so I turned the sprite. Then after the colors worked I had to flip the sprite again, and I made sure all the animations were facing the right way. I tried making events to set them to unflipped on spawning/every tick, and ones to destroy flipped bugs every tick, and I asked/showed my friend who's made many games with C2 and she couldn't figure it out either. Thanks for your help anyways though!
Last edited by misterkoala on Tue Oct 14, 2014 9:05 pm, edited 1 time in total.
B
10
Posts: 28
Reputation: 401

Post » Tue Oct 14, 2014 9:01 pm

here's the updated file if you want to take a look? Also, I've noticed that all the upside down bugs are flying to the left? I'm sure that's relevant but I don't really know how to fix it.
You do not have the required permissions to view the files attached to this post.
B
10
Posts: 28
Reputation: 401

Next

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 17 guests