collision with two actors problem

Mayhem_MadnessMayhem_Madness Member, PRO Posts: 168
edited April 2015 in Working with GS (Mac)

I have an actor, a ball. that when collides with another actor,a post, you get one point and the scene resets. And I have another actor, a wall, that when collides with the ball actor I mentioned, the game ends, and the ball falls to the ground. But the problem is when the ball collides with the wall it falls and sometimes it touches the post as well. So the game doesn't end and you end up getting one point and the scene resets.

So do you know how I would do it so when the ball collides with the wall the ball will fall to the ground, and if it collides with the post as well it won't give me one point and it won't reset the scene.

I hope that makes sense

Thankyou

Thor

Comments

  • SummationSummation Member, PRO Posts: 476

    @thor Make an attribute: wall.

    Make it so if your ball touches the wall then game.wall=1
    Make your win condition to include if game.wall=0

  • Mayhem_MadnessMayhem_Madness Member, PRO Posts: 168

    @Summation said:
    thor Make an attribute: wall.

    Make it so if your ball touches the wall then game.wall=1
    Make your win condition to include if game.wall=0

    @tatiang

    Thankyou summation, but there is one problem after i hit the wall once, when i replay the game, and when the ball touches the post again noting happens, i don't get a point and the scene doesn't reset. It just goes on to hit the wall and falls to the ground.

    Thankyou,

  • Mayhem_MadnessMayhem_Madness Member, PRO Posts: 168
    edited April 2015

    @Braydon_SFX

    Hi Braydon, do you have any ideas on what i should do to fix this problem?

    Thanks.

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

    It sounds like you need to reset the value of whatever attribute you're using (e.g. game.wall) before replaying the game.

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

  • Mayhem_MadnessMayhem_Madness Member, PRO Posts: 168

    @tatiang said:
    It sounds like you need to reset the value of whatever attribute you're using (e.g. game.wall) before replaying the game.

    So would i put change attribute game.wall to 0 in the replay button?

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

    Yes. Right before you Change Scene or Reset Scene or however you're replaying the game.

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

  • Mayhem_MadnessMayhem_Madness Member, PRO Posts: 168

    @tatiang said:
    Yes. Right before you Change Scene or Reset Scene or however you're replaying the game.

    Thankyou very much for that :smile:

    I have one more problem with my game, I have a game.touch.count.

    That when the screen is pressed my actor jumps, but I also have two arrow buttons for going left and right.

    The problem is that when I jump in the air by touching the screen , you can also touch the arrow buttons to move. So once your in mid-air it lets you move left and right.
    Which I don't want to happen.

    So do you know how I would fix this problem?

    Thanks.

  • Mayhem_MadnessMayhem_Madness Member, PRO Posts: 168

    Hi, just to let you know, i figured out how to do it, and i thinks its working now.

    So for anyone who wants to know how to do this, i just did when attribute self.position.y is greater than a particular position.
    Constrain attribute game.moveleft to false.
    Constrain attribute game.moveright to false.

    And thats it.

    Thankyou for the help.

Sign In or Register to comment.