Is there a way to test to see if an actor is touching a color?

Dr_ChowDr_Chow Member Posts: 0
edited October 2014 in Help Wanted

So I am making this game, and the player is flying through obstacles and can't touch them. The obstacles are all connected. Actually it's just kind of one huge thing you have to get through, anyway, if you touch it you die and start over. But, the actor covers the entire screen, even though only part of it is actually visible. So the player is always touching it no matter what.

So is there a way to test to see if my player actor is touching a certain color? Because I don't know how else to make my game work. Thanks!

Also, if you are familiar with programming on Scratch there is a "if touching color [color]..." block. So that is where I'm coming from.

Comments

  • SocksSocks London, UK.Member Posts: 12,822

    Hold the Line ?

  • AlchimiaStudiosAlchimiaStudios Member Posts: 1,069

    Gamesalad does not have real time color sampling if that's what you mean. But your question is very vague so... we can't really give you a solution. MY best guess is you'd want to use multiple actors for collision detection, pixel position detection, or a magnitude radius in this case.

    Follow us: Twitter - Website

  • Braydon_SFXBraydon_SFX Member, Sous Chef, Bowlboy Sidekick Posts: 9,273

    I guess you could detect an actor tag - so all of your red actors are in the "RedTag" group?

  • zypp1zypp1 Member Posts: 142

    hi mate hope this helps

    create game attributes

    red
    green
    blue

    and in the (different coloured actor that gets touched) add rule

    if overlaps with the (main actor )

    timer after 0.1 second

    change attributes
    game. red
    game. green
    game. blue

    to

    self.red
    self.green
    self.blue

    then in the ( main actor ) that touches other colours

    create self attribute

    red
    green
    blue

    and add the rule

    if actor overlaps or collides with actor type/name = (coloured actor name)

    timer after 0.3 seconds

    change attributes
    self. red, green blue

    to

    game. red, green,blue

    then you can add a rule that detects the colour in the main actor

    something like

    if attribute

    self. red,blue,green = 1 ( this is dependant on the colour i.e in the colour section of an actor)

    then destroy actor ext

    hope it helps bro

  • zypp1zypp1 Member Posts: 142

    plus just re read your post and it seems you made a whole level on photoshop say and want the actor to only collide with the floor for instance that is black if this is the case game salad does not work this way you gotta place an invisible floor that an actor can collide with over the photoshop image if you get my drift

Sign In or Register to comment.