calculate the direction of collision. help!!!

imbrendinoimbrendino Member Posts: 37
edited November -1 in Working with GS (Mac)
Hi,
how can I calculate where it comes from the collision in a rectangular shape?

Comments

  • RedlerTechRedlerTech Member Posts: 1,583
    Id simply constrain actors to the sides of the rectangular shape. Then when those actors get hit, you got ur answer!

    Matt
  • imbrendinoimbrendino Member Posts: 37
    how?
  • imbrendinoimbrendino Member Posts: 37
    NextGenEntertainment said:
    Id simply constrain actors to the sides of the rectangular shape. Then when those actors get hit, you got ur answer!

    Matt

    HOW??
  • SkyMapleSkyMaple Member Posts: 817
    imbrendino said:
    HOW??

    Make two global real attributes Called "X" and "Y"

    On the rectangular shape make two constraints
    Constrain "X" to "self.position.X"
    Constrain "Y" to "self.position.Y"

    In the actors on the sides of the rectangular shape

    the one on the left-
    Constrain "self.position.X" to "X-???"
    Constrain "self.position.Y" to "Y"
    the one on the right-
    Constrain "self.position.X" to "X+???"
    Constrain "self.position.Y" to "Y"
    the one on the top-
    Constrain "self.position.Y" to "Y+???"
    Constrain "self.position.X" to "X"
    the one on the bottom-
    Constrain "self.position.Y" to "Y-???"
    Constrain "self.position.X" to "X"

    The amount you add or subtract will change to off set

    Hope this helps!

    _______________________________________

    Game making service- http://gamesalad.com/forums/topic.php?id=21739
    Sketch to vector service- http://gamesalad.com/forums/topic.php?id=21820
    "Power Orb" style template- http://gamesalad.com/forums/topic.php?id=22179
  • imbrendinoimbrendino Member Posts: 37
    SkyMaple said:
    Make two global real attributes Called "X" and "Y"

    On the rectangular shape make two constraints
    Constrain "X" to "self.position.X"
    Constrain "Y" to "self.position.Y"

    In the actors on the sides of the rectangular shape

    the one on the left-
    Constrain "self.position.X" to "X-???"
    Constrain "self.position.Y" to "Y"
    the one on the right-
    Constrain "self.position.X" to "X+???"
    Constrain "self.position.Y" to "Y"
    the one on the top-
    Constrain "self.position.Y" to "Y+???"
    Constrain "self.position.X" to "X"
    the one on the bottom-
    Constrain "self.position.Y" to "Y-???"
    Constrain "self.position.X" to "X"

    The amount you add or subtract will change to off set

    Hope this helps!

    _______________________________________

    Game making service- http://gamesalad.com/forums/topic.php?id=21739
    Sketch to vector service- http://gamesalad.com/forums/topic.php?id=21820
    "Power Orb" style template- http://gamesalad.com/forums/topic.php?id=22179

    Then I have to record where it comes from the blow on the rectangular shape. The objects do not appear immediately so I can not do as you say
Sign In or Register to comment.