Does actor self-destruct when off of the screen?

HappyKat78HappyKat78 Member, BASIC Posts: 173
edited March 2012 in Working with GS (Mac)
Hi All,

It looks to me like an actor automatically destroys itself when off the screen by a certain distance or for a certain amount of time. Is this right and where can I learn more about this? I tried searching for this but couldn't locate anything. I want to destroy an actor when it's left the scene for ~3 seconds and I have a way of doing this using a separate actor that counts when the main actor is off-scene (and if it's 3 seconds it initiates levelfailed), but I just want to make sure I'm doing this in the most efficient way.

Thanks

Comments

  • CloudsClouds Member Posts: 1,599
    :))
    yes, if an actor goes outside the screen area to far it will destroy itself.
    Do you know how far it must go outside the screen before Saladcide occurs ? It'd be good to know.
  • zombieaddictzombieaddict Member Posts: 213
    edited March 2012
    based on a standard iphone screen size it should destroy itself around these co-ordinates

    Actor X = -504 to -509
    Actor X = 980
    Actor Y = 822 to 827
    Actor Y = -502 to -507
  • HappyKat78HappyKat78 Member, BASIC Posts: 173
    Thanks for this. Is there a way to tell when the game has automatically destroyed the actor in this way? I'm thinking a workaround could be to have the actor control a global attribute in some way which would obviously stop when the actor is destroyed but that would require a timer checking it every second, so wondering if there is a more simple way?
  • MotherHooseMotherHoose Member Posts: 2,456
    actually the sceneSize affects the destruction point

    yes … you can make that destruction control another attribute … but you need to constrain another gameAttribute to the moving Actor's X or Y position
    then when that gameAttribute ≥ the destruction point … changeAttribute the on you want it to change
    (this Rule needs to be in a controlActor)

    you can monitor what is going on with DisplayText behaviors in other actors

    @};- MH
  • HappyKat78HappyKat78 Member, BASIC Posts: 173
    Thanks for the info. I decided to go with a boolean that triggers when the actor isn't over the scene and then a timer will count for 3 seconds. If the actor doesn't overlap with the scene within those 3 seconds it assumes it's destroyed or not coming back so triggers the levelfailed attribute. This seems to work well.
Sign In or Register to comment.