How to create Rule when actor goes out of screen destroy it ..

Hello,
i have situation when actor goes out of screen it will destroy and make game over .

Comments

  • KevinCrossKevinCross London, UKMember Posts: 1,894
    edited August 2013
    Look at game.screen.size.width and game.screen.size.height. If actor x and/or y position is less than 0 or greater than game.screen.size.width then destroy actor, i.e.

    When actor position.X < 0 or actor position.X > game.screen.size.width then destroy actor. And likewise for Y if you want to destroy it if it goes past the top or bottom of the screen

    You need to keep in mind that the actors x and y position is in the centre of the actor

  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772
    you could also surround you screen with a trigger actor that will destroy the other actor on collision and end the game.
  • joshiwujoshiwu Member Posts: 207
    Or you can unlock an actor to access scene attribute such as camera origin =)
Sign In or Register to comment.