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

JoshKahaneJoshKahane Member Posts: 470
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 Member Posts: 470
    Well someone knows how to do this becuase it has been done in the basic platformer template. Please help.
  • CodeMonkeyCodeMonkey Head Chef, Member, PRO Posts: 1,803
    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 Member Posts: 470
    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 Head Chef, Member, PRO Posts: 1,803
    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 Member Posts: 470
    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 Head Chef, Member, PRO Posts: 1,803
    You need to set gravity in your scene attributes.

    http://gamesalad.com/wiki/scene_attributes
  • JoshKahaneJoshKahane Member Posts: 470
    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 Head Chef, Member, PRO Posts: 1,803
    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 Member Posts: 470
    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 Member Posts: 470
    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 Member Posts: 470
    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.
Sign In or Register to comment.