Constrain movement to within a scene only

XanthorXIIIXanthorXIII Member Posts: 8
edited November -1 in Working with GS (Mac)
I'm still working out the logic but how would I constrain movement to within a scene. I do not want the actor to go out of the scene but halt when the edge reaches the left or right edge of a scene.
The size of the actor is 136x40.
Thanks.

Comments

  • UtopianGamesUtopianGames Member Posts: 5,692
    Another way would be to have a rule in your actor...if self.position x >0 & <480 and Y>0 & <320...move.

    Darren.
  • UtopianGamesUtopianGames Member Posts: 5,692
    http://gamesalad.com/game/play/93679

    A quick template for you.

    Darren.
  • XanthorXIIIXanthorXIII Member Posts: 8
    Thanks for the great information.
  • XanthorXIIIXanthorXIII Member Posts: 8
    I was unable to download the template. I think it's currently locked to non-downloadable.
  • SnowSnow Member Posts: 124
    Both are excellent answers.. you don't need the template. Both solutions are easy and your actor will stop to the pixel at the edge of the scene... that is provided if you use walls, they are positioned right at the edge.

    You know this made me think though. Tshirt would love this:
    How hard would it be to make a web app that mimics the GS interface? So that just like in GS you could drag an object into the scene and create rules. All it would be is a gui where you drag dummy objects around and have text fields where you can write in parameters. It would be awesome to demonstrate how to do certain functions in GS. You could open up the web app from a button above the "reply" textbox (which, I'm currently typing in, drag your dummy objects around and arrange them, enter necessary text, then when done click a button and it posts an image within the reply box and voila a demo image to help you explain.
  • XanthorXIIIXanthorXIII Member Posts: 8
    I've been able to work out using the keyboard however trying to constrain to mouse I'm finding that once my object hits one of the checks ether less than 68 or greater than 412 which is what I am calculating off of, I lose control of the object.
  • UtopianGamesLtdUtopianGamesLtd Member Posts: 120
    Umm not sure how to make it downloadable as i have deleted it from desktop now, maybe an admin can change it.

    Darren.
Sign In or Register to comment.