Movement

ddavila23ddavila23 Member Posts: 5
Hi Guys,

I'm seriously new to Game Development with GameSalad. Before I posted I looked everywhere but didn't found what I was looking for.

I have a Car with a road that has two lanes. The car starts in the left lane and I'm looking to move it to the right lane after is touched. Now I know how to do this but I want to touch it again and move it back to the left lane and if I touch it again the car moves once again to the right lane. Think you guys can help me? Thanks

Best Answer

  • EatingMyHatEatingMyHat Posts: 1,246
    Accepted Answer
    if you managed to do the rule to move it to the right lane you should be able to do it for the left... basically:

    If touched
    if in the right lane location
    move to left location
    otherwise
    move to right location

Answers

  • ddavila23ddavila23 Member Posts: 5
    So I basically have to create two separate rules and I will have to identify the position for right and left lane right?
  • ddavila23ddavila23 Member Posts: 5
    Sorry for the double Post guys...

    So here is another problem...If I continue to touch the car it continues to go to the right side making the Actor go outside the scene. Think you can help me out?
  • EatingMyHatEatingMyHat Member Posts: 1,246
    your rules should be nested.

    What to you use to move the car to the left/right position?
  • ddavila23ddavila23 Member Posts: 5
    Actor receives event...touch is pressed.

    Move...Direction to 0..Speed 300.

    And for the right side.

    Direction 180 speed 300.
  • EatingMyHatEatingMyHat Member Posts: 1,246
    you need to make sure that the Move stops executing when you get to the X position that it needs to stop, so add that to your rule
  • ddavila23ddavila23 Member Posts: 5
    Can you tell me how to do this?
  • EatingMyHatEatingMyHat Member Posts: 1,246
    How do you decide if to move left or right?
Sign In or Register to comment.