how to stop character in side scroller from going past beginning or end of level

skipnosisskipnosis Member Posts: 21
edited November -1 in Working with GS (Mac)
I'm new to GS but am doing well thanks to tech support and all the helpful people here -

my scroller is now scrolling with three backgrounds and the main character is walking in place in the center of the screen - LOVING IT.

one thing I can't figure out is at the beginning of the level if I move the character left he goes off the end of the stage (i mean the background art scrolls past him to the right till it's all gone).

is there some way to prevent this?

a million thanks in advance.

Comments

  • jstrahanjstrahan Member Posts: 498
    Answered in other post
  • AfterBurnettAfterBurnett Member Posts: 3,474
    Set up an invisible actor and place at both ends of the scene (uncheck visibility in the actor's properties) and add the collide behaviour. Set it to collide with your character and lower the restitution so they don't bounce. These actors will work as the "walls". Pretty simple :)
  • skipnosisskipnosis Member Posts: 21
    sweet thanks js!
  • skipnosisskipnosis Member Posts: 21
    not sure what "lower the restitution" means...
  • jstrahanjstrahan Member Posts: 498
    On ur actor attributes under physics there's a setting for resitution change it to 0
  • skipnosisskipnosis Member Posts: 21
    yep found it but it for some reason it didn't work..

    perhaps I need to add the collide behavior not to the wall but to the scrolling background and attribute it to the wall...
  • jstrahanjstrahan Member Posts: 498
    Add collide to player
  • skipnosisskipnosis Member Posts: 21
    shoot didn't work....

    do the actors have to be on stage or can they be off?
  • skipnosisskipnosis Member Posts: 21
    sorry j to be such a hack -

    i may not have been clear - the player is in the center of the screen animating in place...

    when i press the move left button (which scrolls the background right) the background is moving off the stage

    so to set up the player colliding with the wall doesn't seem right...

    you think it would be stopping the background when it collides into the wall..
  • jstrahanjstrahan Member Posts: 498
    Change camera to reach from side to side but only as tall as player
Sign In or Register to comment.