GameSalad

Howdy, Stranger!

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

Help with Making Actor Jump: Need Help From Who Made the Templates

JoshKahaneJoshKahane Posts: 470Member
edited November -1 in Working with GS (Mac)
Hi

So in the template the actor called Player (the small blue guy) I have been looking at him loads and can't figure out how to make my own actor jump in my game. Any help? Thanks.

Comments

  • JoshKahaneJoshKahane Posts: 470Member
    Well someone knows how to do this becuase it has been done in the basic platformer template. Please help.
  • CodeMonkeyCodeMonkey Posts: 1,803Head Chef, Member, PRO
    A jump is a quick acceleration upward. i.e. Timer (for .1 sec) accelerate up at speed of 9000.

    But you only want to jump if you are touching the ground. i.e. if collides with ground, 'touchingground' = true

    and when you jump, 'touchingground' = false.
  • JoshKahaneJoshKahane Posts: 470Member
    I think I am getting somewhere (thank you CodeMonkey I appreciate it), what you say makes sense but I cant make it work in GameSalad, currently my actor stays still. Here are the rules I have given him so far, what I have I done wrong?

    http://img31.imageshack.us/i/picture1bip.png/
  • CodeMonkeyCodeMonkey Posts: 1,803Head Chef, Member, PRO
    1. Need to set touchingground to be false as soon as you jump. So in the same actor as you start the timer.
    2. Need to set it to true when ANY of the conditions is true. Unless you do want the actor to collide with both actors at the same time to enable touching ground.
  • JoshKahaneJoshKahane Posts: 470Member
    Ok this has just completely buggered my brain up haha. So far my actor jumps up, but doesnt fall back to my ground actor. If at all possible, I know it might be a pain, but could someone please take a screenshot like mine above showing me what to put on my actor.
  • CodeMonkeyCodeMonkey Posts: 1,803Head Chef, Member, PRO
    You need to set gravity in your scene attributes.

    http://gamesalad.com/wiki/scene_attributes
  • JoshKahaneJoshKahane Posts: 470Member
    Ok, Im getting somewhere. I have added gravity, but yet more issues, haha. Sorry Im being a drag.

    Now, my character actor drops back down, but bounces back up because of gravity, so do I need to add a rule so that when the character actor hits the ground actor it stops moving? Something like that?

    Also, how do I stop my character actor form flying/staying in the air when you keep pressing up?
  • CodeMonkeyCodeMonkey Posts: 1,803Head Chef, Member, PRO
    The Restitution attribute sets how much it or the actor which hits it bounces. Also in the Physics attributes of an actor.

    It should only be able to jump when the attribute is set when it is touching(colliding) with the ground.
  • JoshKahaneJoshKahane Posts: 470Member
    Ok still no success. Don't know what I am doing wrong. My actor still stays in the air when you keep pressing up and still bounces up when it hits the ground. Could you tell me what to do in a little more detail please, sorry, I just can't get it right.
  • JoshKahaneJoshKahane Posts: 470Member
    No worries, I have now managed to keep my character actor from flying, but it still bounces, how can I stop this? I cant get anything to work.
  • JoshKahaneJoshKahane Posts: 470Member
    Done it! Woo, thanks Codemonkey, wouldn't have without your help. Finally did it, I had only set the restitution on one actor, but with it on 0 on both actors, my character actor now jumps perfectly.
This discussion has been closed.