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" ?>
<c2project>
    <name>New project</name>
    <description></description>
    <version>1.0.0.0</version>
    <author></author>
    <author-email></author-email>
    <author-website>http://</author-website>
    <app-id>com.mycompany.myapp</app-id>
    <unique-id>3m8tg9o0p3boj</unique-id>
    <saved-with-version>17600</saved-with-version>
    <used-plugins>
        <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-plugins>
    <used-behaviors />
    <used-effects />
    <configurations>
        <configuration exporter-descname="HTML5" exporter-id="html5" name="HTML5" />
    </configurations>
    <window-size>
        <width>854</width>
        <height>480</height>
    </window-size>
    <pixel-rounding>0</pixel-rounding>
    <preview-effects>1</preview-effects>
    <use-loader-layout>0</use-loader-layout>
    <configuration-settings>
        <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>
    </configuration-settings>
    <object-folder expanded="1">
        <object-type name="Sprite" sid="5116692846491035">
            <plugin id="Sprite" />
            <instance-variables>
                <instance-variable name="color" sid="9746322920607333" type="string" />
                <instance-variable name="id" sid="2015740291466653" type="number" />
            </instance-variables>
            <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" />
                </animation>
            </animation-folder>
        </object-type>
        <object-type name="TextBox" sid="5555530367750661">
            <plugin id="TextBox" />
        </object-type>
        <object-type name="Text" sid="6681593308728346">
            <plugin id="Text" />
        </object-type>
        <object-type name="Text2" sid="2053243861294757">
            <plugin id="Text" />
        </object-type>
    </object-folder>
    <families />
    <layout-folder expanded="1">
        <layout>Layout 1.xml</layout>
    </layout-folder>
    <event-folder expanded="1">
        <event-sheet>Event sheet 1.xml</event-sheet>
    </event-folder>
    <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" />
        </file-folder>
    </files-folder>
</c2project>


@fasasoftware just donwload the last beta version i had the same problem when i was learning :mrgreen:
yolinux
B
18
S
5
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 ;)
B
38
S
11
G
5
Posts: 485
Reputation: 5,340

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:
http://www.fasasoftware.com
B
4
S
1
Posts: 73
Reputation: 504

Previous

Return to How do I....?

Who is online

Users browsing this forum: Yahoo [Bot] and 6 guests