Same enemy in different colors

Get help using Construct 2

Post » Wed Aug 01, 2012 8:01 pm

Hi, I've been working in a game and so far I just have 1 kind of enemy, so I was wondering if there's a way to have sprites in different colors
and then changing them randomly during the creation event.

Thanks.
B
4
Posts: 13
Reputation: 401

Post » Wed Aug 01, 2012 10:39 pm

youd have to have graphics for each color and then make animations from those just like the normal original color. Until r100 (probably) there wont be a way to recolor a sprite effectively at runtime
B
13
S
5
G
2
Posts: 306
Reputation: 3,262

Post » Wed Aug 01, 2012 10:45 pm

Like aridale said, it will be available with WebGL shaders in r100. It is currently possible to do it with the "source atop" effect. Check out R0J0hound's example here. Or you could try out Pode's "Recolor Sprite" behaviour. (I haven't tried it though)Nimtrix2012-08-01 22:46:40
B
27
S
8
G
8
Posts: 903
Reputation: 8,452

Post » Thu Aug 02, 2012 1:02 am

Thanks, I'll look into the examples.

About the option in which I create the graphics for different colors, is this what you mean?

Objects:
EnemyBlue
EnemyRed
EnemyYellow

Then I would have to create all the events that currently involve an 'Enemy' Instance 3 times? One for each new colored object? or is there a way to treat the 3 objects as just one?
B
4
Posts: 13
Reputation: 401

Post » Thu Aug 02, 2012 1:06 am

Nah, he meant having different animations in one object. That way you'll need only one set of events. OR you could do it like you just said with multiple objects and use families, but you'll need a license for that.
B
27
S
8
G
8
Posts: 903
Reputation: 8,452

Post » Thu Aug 02, 2012 3:19 am

Ok, I solved it, I didn't know you could concatenate strings but I used several animations like attack1 and attack2 and then in the event changed the animation to "attack" & enemy.color   where color would be 1 or 2.

thanks a lot!

B
4
Posts: 13
Reputation: 401


Return to How do I....?

Who is online

Users browsing this forum: 99Instances2Go, Ethan, Marxally, Naightwolf, pierre244 and 16 guests