Detecting which side of a solid rectangle actor the player actor has collided with

JosephMJosephM Member Posts: 4
edited August 2012 in Working with GS (Mac)
In my platform game, I'm trying to find out how to determine which side of a solid square/rectangle actor the player actor has collided with.

I'd like to write this to an attribute so I can make some events only happen when the player collides with the top, or the left side etc.


I've been trying to find out how to accomplish this for a few hours now and I've got nowhere. I thought I'd be able to use AngleToVector but for some reason that's not even returning a value (not sure why!)

Any help? Thanks, Joseph

Comments

  • kinzuakinzua Member Posts: 554
    @JosephM also try by comparing X&Y manually.. for e.g... when collision happens.. record the player X,Y to playX playY and then create the logic accordingly.. like.. if playX>objX and playY>objY.. then do this.. u can figure out the logic..
  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772
    You might find this tutorial helpful. It is specifically detecting a collision with an enemies top but you could apply the same concept to the sides and bottom of actors.

    http://www.jamie-cross.net/?p=607

    Jamie
Sign In or Register to comment.