How to detect if actor is still touch another actor.

JamesBoucherJamesBoucher Member Posts: 433
edited November -1 in Working with GS (Mac)
In my game i need to know if an actor is still overlapping another actor. I can have an actor overlapping three to four actors at once. Also the actors can move in and out from under the overlapping actor.

Any ideas on how to determine this?

Comments

  • JamesBoucherJamesBoucher Member Posts: 433
    Any help would be great.... Thanks.
  • hrsmediahrsmedia Member Posts: 522
    Are you using the collide rule?
  • JamesBoucherJamesBoucher Member Posts: 433
    Let me explain a little better. I have an actor that grows in size when the screen is touched. It can collide with other actors. The other actors can then move away from the actor that's growing. When the player releases his touch from the screen I need to know what actors are currently still touching the growing actor.

    Yes I know how to use the collide rule, but that does not tell me all actors still in collision at the time the user lefts his touch.
  • HachikoHachiko Member Posts: 330
    You could have a self attribute, when actor collides with actorthatgetfat change attribute to true, otherwise set it to false. So, maybe, the actors that gets away from it should change their attribute to false, while the other not. And then you can check if that attribute is true do that, if not do nothing.
    If this don't work, you can try to check if the X attribute of the little actor are between the X attribute of the big actor less half of the width size and the x attribute of the big actor plus half of the width size.

    But like this, if one of the little actors is away just of half and 1 pixel from the big actor, it will not count as in collision.
Sign In or Register to comment.