Problem with collisions

garyk1968garyk1968 Member Posts: 8
edited November -1 in Working with GS (Mac)
Hi,

I am just playing around with a game at the moment. I have a tank actor which I can rotate and can fire a bullet actor. Now the tank rotates using the left and right buttons and I simply spawn a bullet actor when pressing the spacebar. Now the problem is when the bullet hits a wall it keeps bouncing until it gets to the end of the wall and keeps trying to go in the original direction. Difficult to explain but this video (very small 129k) demonstrates what I mean here

Comments

  • firemaplegamesfiremaplegames Member Posts: 3,211
    Do you want the bullets to bounce backwards when it hits a wall? (like in billiards?) so you can make bank shots?
    If so, you can look at my demo here:

    http://gamesalad.com/game/play/31279

    I made it to show off the magnitude function, but it shows how to bank off of walls as well.

    Or do you just want the bullets to explode when they hit a wall?
    That's much easier, You just need to add a rule:

    When Actor collides or overlaps with Actors of Type Wall
    Spawn Actor: Explosion
    Destroy Actor
  • garyk1968garyk1968 Member Posts: 8
    Thanks firemaple, yes I want them to bounce off, I'll check your demo, cheers!
Sign In or Register to comment.