Basic Game Function Help - Jumping from top to bottom of screen

brandonjabrbrandonjabr Member Posts: 9
edited January 2012 in Working with GS (Mac)
I'm making a basic iPhone game in which you control a square that is moving right through a tunnel, and spikes are coming at you that you have to dodge.

Here's my problem:

I want to make it so (starting with the square on the bottom platform) when you press anywhere on the screen, he jumps quickly to the top platform and stays there

Then, when you press anywhere on the screen again, I want him to jump back down to the bottom platform and stay put

Now when I tried to use functions like "Move To", "Move", "Accelerate Toward" Etc, they always seem to glitch up, (ie. when I use two opposing "Move To" functions, the square will get stuck at the top)

What's a simple way I can implement this game feature?

Thanks a lot!


  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,944
    It sounds like you're just missing a condition for the jumps. One way to do it would be to say: when the actor collides with the bottom platform AND mouse button is down, [move to top platform]; when the actor collides with the top platform AND mouse button is down, [move to the bottom platform]. That way, when you play it, you have to wait until you're at a platform before you can move to the other one. You can't switch back and forth in the middle.

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

  • brandonjabrbrandonjabr Member Posts: 9
    I actually tried doing that tatiang, and strangely it doesn't seem to work well. What function should I be using to move it? Just "move" or "move to" for the specific positions? Thanks
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    Hey there,

    For the future please dont create multiple threads on the same topic. You have 2 threads right at the top asking the same thing, and both have answers in them.

Sign In or Register to comment.