Move

ddavila23ddavila23 Member Posts: 5
edited June 2012 in Working with GS (Mac)
Hi Guys,

I recently started working on a project. It's a over the Top View Car game. I have a road with two lanes I'm looking to move the Car from one Lane to the other and so on. I want it to be Touch Based so when I touch it once the car changes to the right lane and when I touch it again the car changes to the left lane. I still can't manage to have this done. Anyone can help me out?

Best Answer

  • tenrdrmertenrdrmer Posts: 9,934
    Accepted Answer
    I would do this.

    First you need a game attribute called lanenumber

    Then in your car do
    when touch is pressed
    -Change game.lanenumber to (game.lanenumber+1)%2

    Then a second rule

    When game.lanenumber = 0
    -interpolate self.position.x to (LeftLanePosition)
    Otherwise
    --interpolate self.position.x to (RightLanePosition)

Answers

  • ddavila23ddavila23 Member Posts: 5
    Awesome!!! That worked out! You are a savior LOL! Thanks!
Sign In or Register to comment.