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

0 favourites
  • 11 posts
From the Asset Store
Color all tiles with the same color in 22 moves or less!
  • 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 @ )

  • 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)

  • 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!

  • try changing the for each loop to bug - on created.

  • spacedoubt Oh that worked!! But now half of the bugs are upside down when they spawn?

  • You must figure this one out on your own, young jedi.

  • spacedoubt ahhg can you give me a hint? ;P I've tried like a million different tweaks

  • 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.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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!

  • 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.

  • I only had to disable one line of code to fix it. You have a line of code in there that's flipping them upside-down. Disable it, no more upside-down. If you (and your friend) can't figure that out, then you need to start over with something simpler.

    You're approaching an awful lot of things in a very messy way. Doing the beginner tutorials will get you thinking the way you need to be thinking. Trust me!

    (I'm trying to help! but I can't make your game for you...)

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)