Move
![ddavila23](http://forums.gamesalad.com/applications/dashboard/design/images/defaulticon.png)
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?
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
-
tenrdrmer Posts: 9,934
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