How to keep actors in the play area?

Shadowghost135Shadowghost135 Member Posts: 38
edited November -1 in Working with GS (Mac)
Hey guys,
I was just wondering how do you keep your (pop-up) actors within the screen of the iphone (landscape)? I've got it running now where I have random actors popping up at different times (its a speed based game), but I notice that they keep popping up outside of my play area and in the upper right hand corner a lot. Can someone please tell me what I should do to fix this? Thank you everyone.

Comments

  • StusAppsStusApps Member, PRO Posts: 1,352
    i assume the actors must have a spawn position that is set as random. set the limits for the random number so they are inside the iphone screen size. Also make them relative to the scene and not the actor. (I have chosen 40-280 and 40-440 to give a bit of space at the side of the screen).

    So...

    spawn actor
    -> random(40,440) relative to scene
    ^ random(40,280) relative to scene

    Hope that makes sense.
  • Shadowghost135Shadowghost135 Member Posts: 38
    Perfect!!!!! Thank you so much :-D
Sign In or Register to comment.