Interpolate Troubles

TouchTiltGamesTouchTiltGames Member Posts: 1,162
edited November -1 in Working with GS (Mac)
I'm trying to get an actor to move across the screen when you hit a button with interpolate instead of accelerate as it's much smoother. This is what I have:

when game.actor =1
interpolate: self.position.x to 200
duration 1

Reset rule
self.position.x = 200
self.position.x to self.x
duration 1

But this is just moving the actor back to where it started..Would anyone know how to keep the actor to where it moves to without it going backwards?

cheers,
shane

Comments

  • scitunesscitunes Member, Sous Chef Posts: 4,047
    Do you want it to go back to it's original position?

    If so, create a self integer attribute called InitialX

    Put a change self.initialX to self.position.X before the interpolate behavior.

    Then use this attribute in place of the "self.x" that you describe above.
  • TouchTiltGamesTouchTiltGames Member Posts: 1,162
    Hey Sci,

    No no..I want it to stay where it is, so at the 200 mark. Think of a platformer with a character moving across the screen. Right now the prob is that is IS going back to its original position hehe.
  • scitunesscitunes Member, Sous Chef Posts: 4,047
    Can't you just use the interpolate without the reset rules?
  • TouchTiltGamesTouchTiltGames Member Posts: 1,162
    Yeah I can remove the reset rule and that of course won't bring the actor back to where it started, but I can't reset it so you can move it again..it only interpolates/moves once. I'm trying a few things now like changing attributes and rules if self.position > then move again...just not sure why I can't move again.
  • AfterBurnettAfterBurnett Member Posts: 3,474
    Because it's set to 200, so it will move there and stay there. If the character is moving right, try putting "when button pressed, move to self.position x +20 (or whatever number)."
Sign In or Register to comment.