3 places help?

I'm trying to get a character to move between 3 places (1#=X-80,Y- 120 2#=X-160,Y-120 3#=X-240,Y-120)
without my character moving past them.
I can't think of a way to do this.
Help?

Comments

  • outsidethebyteoutsidethebyte Member Posts: 115
    I'd interpolate the X and Y positions of the character that you need to move. I could add more specifics if you better explain the situation you are trying to create.
  • qazxcweqazxcwe Member Posts: 2
    I'd interpolate the X and Y positions of the character that you need to move. I could add more specifics if you better explain the situation you are trying to create.
    In the game the background scrolls to give the impression of movement and it looks like you are running forward.
    You have to dodge obstacles by jumping between 3 different lanes.
    If you crash into an obstacle you die.
    That's the basics of what I'm trying to achieve.

  • outsidethebyteoutsidethebyte Member Posts: 115
    I would certainly use interpolate then. In whatever actor or event that causes the character to jump between lanes, have the actor use two separate interpolations of the actor's X and Y position to the proper coordinates. You can fiddle with the time it takes and whether or not you want it to be linear or easing. However, if you want the jump between lanes to be instant, you can just change the X and Y position.
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • qazxcweqazxcwe Member Posts: 2
    Sort of like this?

    https://forums.gamesalad.com/discussion/48371/new-running-game-free-template/p1
    Pretty much what I was going for except mine haz gunz

Sign In or Register to comment.