How do I Test if 2 sprites whenthey collide,have same color?

Get help using Construct 2

Post » Mon Aug 11, 2014 10:20 am

How do I Test if 2 sprites when they collide,have same colors?

In few words.... i need to test if 2 sprites when are overlapping....and/or one on up each other.have same colours and ..i need to return true or false...

Is there a plugin...or function in construct2 to do this???

I thank you so much in advance.......

best regards,

Lestroso

http://www.fasasoftware.com
B
4
S
1
Posts: 73
Reputation: 504

Post » Mon Aug 11, 2014 11:04 am

You can't check the sprite colour by default, but i guess the sprites had different animations so you can check them for example if sprite playing animation blue and other playing red then do something, or add a value that indicates the colour and set it when object is created, or you can add an effect "replace the colour" and check it's rgb, but it is laggy.
B
22
S
9
G
7
Posts: 421
Reputation: 6,543

Post » Mon Aug 11, 2014 5:35 pm

Dear Sisyphus,

i thank you so much, but if you can are you be able to show me with a capx your idea example?.....because...i'm a beginner and i don't know where i must start....

Or if there's someone else who can help me , i will thank you in advance...

Best regards,

Lestroso

http://www.fasasoftware.com
B
4
S
1
Posts: 73
Reputation: 504

Post » Mon Aug 11, 2014 6:00 pm

Use instance variables and compare?
B
34
S
9
G
3
Posts: 493
Reputation: 4,067

Post » Mon Aug 11, 2014 6:14 pm

@fasasoftware
You want to create puzzle game don't you?

here the demo with the source:
collapse-puzzle-under-50-events_t90043

There is a event that cover how to detect 2 or more instances with same color in my example, simple approach
ImageImage
B
108
S
49
G
23
Posts: 783
Reputation: 22,611

Post » Mon Aug 11, 2014 7:06 pm

hope this help is not the best code but you will understand i hope

@alextro great stuff!!
You do not have the required permissions to view the files attached to this post.
yolinux
B
18
S
5
Posts: 19
Reputation: 1,545

Post » Mon Aug 11, 2014 7:40 pm

Dear Friends......

There's no words to thank you!!! Now i'll take a look about your demo capx examples.....and then i 'll feedback with you...

Thousands Thanks To Everybody!!!

Lestroso,
http://www.fasasoftware.com
B
4
S
1
Posts: 73
Reputation: 504

Post » Tue Aug 12, 2014 7:09 am

Dear kossak,

I have tryed to open your demo software"same color.capx" but ...the system says to me that you have made with a newer version the 176 beta new release.....i use the 173 stable release......can you so kind to convert your software for the 173 stable release??? i thank you so much.....

Best regards,

Lestroso

http://www.fasasoftware.com
B
4
S
1
Posts: 73
Reputation: 504

Post » Tue Aug 12, 2014 9:29 am

you can open it by opening the capx with an archiever like winrar and then edit the .caproj, there is something like saved with version, change it to your version and you will be able to open it
B
38
S
11
G
5
Posts: 485
Reputation: 5,340

Post » Tue Aug 12, 2014 10:08 am

Thanks a lot fldr......

I'll do....thanks again for your support....

Happy Summer To Everybody!!!

Lestroso,
http://www.fasasoftware.com
B
4
S
1
Posts: 73
Reputation: 504

Next

Return to How do I....?

Who is online

Users browsing this forum: Artcadev and 40 guests