If a colour is touched lose

Hi
i want a rule where if a actor is not surrounded by black then change scene. or if a colour thats not black touches a acto change scene.

Comments

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    Describe the game in more detail and provide a sketch or screenshot if possible so that we have some idea of what you're trying to do.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • mrcameron999mrcameron999 Member Posts: 182

    Ok so i have a circle and you have to click the circle and make it jump over stuff. If it touches and of the objects you lose. But some of the objects are circle so they would touch because the shape is a square

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    Then you would name your actor blackCircle (for example) and have a collision rule for that actor. I assume it's more complicated than that but it's hard to understand without a picture, sorry.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • mrcameron999mrcameron999 Member Posts: 182

    Here is an illustration

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    So the black circle sits inside the yellow area and if it moves at all then it changes scene? I feel like a detective getting clues...

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited March 2014

    @mrcameron999‌ Oh wait, I think I understand. If the black circle on the left touches the black part of the rectangle actor it's okay but if it touches the yellow it changes scene.

    There is no way to check the color of part of an actor but you might be able to have two actors, one a yellow rectangle and one a black oval (with collision shape set to circle) and then in your black circle actor have this rule:

    When actor collides with [black actor] -- do nothing --
    Otherwise
    .....When actor collides with [yellow actor]
    .....Change scene

    It's not perfect because if the circle actor starts in the black area and then strays into the yellow it won't count as a collision.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • mrcameron999mrcameron999 Member Posts: 182

    Ok so basically the collision shape is circle but when you touch the collision area which is the yellow bit it changes scene i want it to change scene when you touch the black bit.

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    Since custom collision shapes are not supported, your options are to try my suggestion above or to use some fairly sophisticated math to determine the perimeter of the oval and create rules to check overlap. I'm not going to be able to do that math for you but someone else here might have a suggestion.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • mrcameron999mrcameron999 Member Posts: 182

    ok thanks for your time

Sign In or Register to comment.