GameSalad

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Movement

ddavila23ddavila23 Posts: 5Member
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,246Member
    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 Posts: 5Member
    So I basically have to create two separate rules and I will have to identify the position for right and left lane right?
  • ddavila23ddavila23 Posts: 5Member
    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 Posts: 1,246Member
    your rules should be nested.

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

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

    And for the right side.

    Direction 180 speed 300.
  • EatingMyHatEatingMyHat Posts: 1,246Member
    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 Posts: 5Member
    Can you tell me how to do this?
  • EatingMyHatEatingMyHat Posts: 1,246Member
    How do you decide if to move left or right?
This discussion has been closed.