Triangle Collision

DavidsChannelDavidsChannel Member Posts: 44
edited July 2012 in Working with GS (Mac)
Hello Guys,

in my game i have blocks. One of my block types should be a triangle (like a rectangle but sliced in the diagonal middle). How can i make my ball collide with the triangle (theres only rectengle and circuar shapes for collision)

Thanks
DavidsChannel

Best Answer

Answers

  • InLaNocheInLaNoche Member Posts: 20
    edited July 2012
    Are you talking about the actual colission box, or the reaction from the colission?

    I believe they only have box and circle for the colission box, but this does not mean you cannot control the reaction of said colission. You could check the object of the colission, and if it's a triangle, you can have it "bounce" off at a 45 degree angle.

    If you are talking about the visual of the colission, I'm not there yet myself.
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598

    @DavidsChannel

    Hi, as you and @InLaNoche rightly say, there's only square and circle shapes collision detection at the moment.

    So for something like a triangle, you'll need to put three transparent actors on the triangle's sides to detect collision. If the triangle image is moving, the three transparent "collision detectors" will need to move with it using Constrain Behaviours. Hope that helps out.

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • DavidsChannelDavidsChannel Member Posts: 44
    Well thank you!

    I will hope gamesalad will make an collision box around the alpha channel, so you can almost collide with every shape.
Sign In or Register to comment.