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

Get help using Construct 2

Post » Tue Aug 12, 2014 12:46 pm

@fldr where is ? maybe another time because i cant find :(
Code: Select all
<?xml version="1.0" encoding="utf-8" ?>
    <name>New project</name>
        <plugin author="Scirra" id="Sprite" version="1">Sprite</plugin>
        <plugin author="Scirra" id="Text" version="1">Text</plugin>
        <plugin author="Scirra" id="TextBox" version="1">Text box</plugin>
    <used-behaviors />
    <used-effects />
        <configuration exporter-descname="HTML5" exporter-id="html5" name="HTML5" />
        <prop name="Clear background">Yes</prop>
        <prop name="Downscaling">Medium quality</prop>
        <prop name="Enable WebGL">On</prop>
        <prop name="Fullscreen in browser">Letterbox scale</prop>
        <prop name="Fullscreen scaling">High quality</prop>
        <prop name="Loader style">Progress bar &amp; logo</prop>
        <prop name="Orientations">Any</prop>
        <prop name="Pause on unfocus">No</prop>
        <prop name="Physics engine">Box2D web</prop>
        <prop name="Preload sounds">Yes</prop>
        <prop name="Preview browser">(default)</prop>
        <prop name="Sampling">Linear</prop>
        <prop name="Use high-DPI display">Yes</prop>
    <object-folder expanded="1">
        <object-type name="Sprite" sid="5116692846491035">
            <plugin id="Sprite" />
                <instance-variable name="color" sid="9746322920607333" type="string" />
                <instance-variable name="id" sid="2015740291466653" type="number" />
            <animation-folder expanded="1">
                <animation framecount="2" loop="0" name="Default" pingpong="0" repeatcount="1" repeatto="0" sid="9711695559715845" speed="0">
                    <frame duration="1" hotspotX="0.5" hotspotY="0.5" />
                    <frame duration="1" hotspotX="0.5" hotspotY="0.5" />
        <object-type name="TextBox" sid="5555530367750661">
            <plugin id="TextBox" />
        <object-type name="Text" sid="6681593308728346">
            <plugin id="Text" />
        <object-type name="Text2" sid="2053243861294757">
            <plugin id="Text" />
    <families />
    <layout-folder expanded="1">
        <layout>Layout 1.xml</layout>
    <event-folder expanded="1">
        <event-sheet>Event sheet 1.xml</event-sheet>
    <global-instances />
    <sounds-folder expanded="1" />
    <music-folder expanded="1" />
    <files-folder expanded="1">
        <file-folder expanded="0" name="Icons">
            <file name="icon-16.png" />
            <file name="icon-32.png" />
            <file name="icon-114.png" />
            <file name="icon-128.png" />
            <file name="icon-256.png" />
            <file name="loading-logo.png" />

@fasasoftware just donwload the last beta version i had the same problem when i was learning :mrgreen:
Posts: 19
Reputation: 1,545

Post » Tue Aug 12, 2014 1:08 pm

11th row in the code you posted, change 17600 to whats written in one of your caproj's, i guess 17300 but better just look into one of your caproj's ;)
Posts: 485
Reputation: 5,365

Post » Tue Aug 12, 2014 5:41 pm

Dear Kossak,

thank you for your Capx same color example....i saw it... but i don't understand the example,,,,in other words... i don't see any test of sprite if they are collide or not... you put a random color or blue or red....ok... but i'm sorry i don't understand....

My idea is to test if two sprite or images are the same color but are always sprite if they are one up one each other(i think collide expression) then do something... like play a sound.....for example....much simple.....

I'm so sorry....for my misunderstanding.....but this piece of code for me it's very important... i thank you again for your time dedicatetd to me....

Best regards,

Lestroso :oops:
Posts: 73
Reputation: 504


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 9 guests