Constraining Actor and Scrolling Camera

TouchTiltGamesTouchTiltGames Member Posts: 1,162
edited November -1 in Working with GS (Mac)
Ok so here's what I'm trying to do, like always, I almost get there but get stuck on one last thing :0

I've got an actor in a platformer setting constantly moving right and is constrained on the X at say 200px. I always want the actor to stay in the same position while its moving instead of ending up hitting the right side of the screen, about the first 1/4 of the screen. So I've got all that setup, but the screen/camera isn't scrolling obviously because the actor is constrained.

I tried an invisible camera tracker to follow that is constrained to the moving actor but that doesn't work because it's constrained to the hero :p.

So what's the easiest way to keep the actor in the same spot yet have the camera scroll so you can scroll past other scrollable objects ?

cheers,
shane

Comments

  • TouchTiltGamesTouchTiltGames Member Posts: 1,162
    Anyone ever do this for their platform/side scrolling game?
  • CodeMonkeyCodeMonkey Head Chef, Member, PRO Posts: 1,803
    A couple of choices here:

    1)Try scrolling the background instead.
    2) Or limit the ability of your scrolling actor by putting in a rule that stops moving right when it hits the end of the scene.

    Rule: If self.Position.X < (scenesize)-280
    -- Move: 0 degrees

    So when it gets to that limit it no longer moves right.
  • TouchTiltGamesTouchTiltGames Member Posts: 1,162
    CodeMonkey said:
    A couple of choices here:

    1)Try scrolling the background instead.
    2) Or limit the ability of your scrolling actor by putting in a rule that stops moving right when it hits the end of the scene.

    Rule: If self.Position.X < (scenesize)-280
    -- Move: 0 degrees

    So when it gets to that limit it no longer moves right.

    Thanks guys,

    The scrolling objects are on a scrollable layer.

    When you say (scenesize) are you referring to 'game.Screen.Size.Width' or are you just referring to the "scene size" with -280?

    @TSB - Yeah I tried Orbz demo but his setup is a lot different than mine but I understand what he's doing there..
  • TouchTiltGamesTouchTiltGames Member Posts: 1,162
    How the F is Orbz' Alien in his Camera tracker demo even moving? I've deleted all the attributes lol.
Sign In or Register to comment.