Checking if an actor is out of the scene?

AppArcadeAppArcade Member Posts: 64
edited November -1 in Working with GS (Mac)
I'm making a game where I need to change an atribute when an actor is out of the screen.
Anybody knows how to do this, would be a lot of help!

Thanks!

Comments

  • sebmacflysebmacfly Member Posts: 1,018
    Create an actor called "out of scene" for exemple, and place it out of the scene... to the right, left up and down.

    When your other actor overlaps or collide with that "out of scene" actor, use any rule you need ;)

    Hope that will help you
  • POMPOM Member Posts: 2,599
    if you mean out of the scene by position, then make a simple rule :

    When ANY attribute :
    self.positionY > 480
    self.positionY < 0
    self.positionX > 320
    self.positionX < 0

    depend on your scene size and orientation , but you got the point.

    Roy.
  • sebmacflysebmacfly Member Posts: 1,018
    p-o-m said:
    if you mean out of the scene by position, then make a simple rule :

    When ANY attribute :
    self.positionY > 480
    self.positionY < 0
    self.positionX > 320
    self.positionX < 0

    depend on your scene size and orientation , but you got the point.

    Yeah, right, but you have to adjust it if your actor have to be entirely out of scene... (because of center actor position...)
    Exemple if your actor is 100x100, add 50 for Y and 50 for Y

    (Sorry for my english...)
  • POMPOM Member Posts: 2,599
    @sebmacfly
    yes you are right, if the idea is so the actor graphic is out so you need to play with the numbers.
    thank you for clarify this one, (my english is bad as well we are on the same boat)

    Roy.
  • AppArcadeAppArcade Member Posts: 64
    Thanks a lot to all of you!
    I will try both solutions and see what works the best for me!

    And TSB Yes it destroys when it leaves the screen :D

    cheers!!!
Sign In or Register to comment.