Making character jump?

allc1865allc1865 Member, PRO Posts: 777
Hi. How do I make my character jump when I press a button. Not using my arrow keys, but a button that I have made and placed on my screen. Any help would be great! Thanks!

Best Answers

«13

Answers

  • GM_PandagamesGM_Pandagames Member Posts: 228
    put attribute like arrows and then put selfmotionlinearvelocity to 500 or something. there is also a gamesalad free template
  • KillerPenguinStudiosKillerPenguinStudios Member Posts: 1,291
    Hey @allc1865,
    We the community don't mind and ove helping but we do like to see that you have tried and looked before hand. There are PLENTY of tutorials that help with this as well as free templates. You just have to be willing to look and try things! Just saying, try and search the forums and web for answers before jumping right into asking.
  • -Timo--Timo- Member Posts: 2,313
    Make a boolean attribute. (lets say we call it jumping) inside the button place a rule
    When touch is pressed
    Change game.jumping to true
    Otherwise to false

    Inside player if game.jumping is true
    Change self.motion.linear velocity.y to 500(or something)
  • KillerPenguinStudiosKillerPenguinStudios Member Posts: 1,291
    Make a boolean attribute. (lets say we call it jumping) inside the button place a rule
    When touch is pressed
    Change game.jumping to true
    Otherwise to false

    Inside player if game.jumping is true
    Change self.motion.linear velocity.y to 500(or something)
    Don't hold his hand @timolapre! Our new friend needs to learn to walk on his own! HAHAHAHAHAHAHAH =)) I'm j/k!!!

    But I want to add, don't forget to add gravity in to the equation. If not, then the character is just going to keep moving up, up, and away. Then you can say bye to the little guy! :-h hahhahha \:D/
  • allc1865allc1865 Member, PRO Posts: 777
    @KillerPenguinStudios, thanks for the advice!
  • -Timo--Timo- Member Posts: 2,313
    Oh yes ofcourse @Killerpenguinstudios ;) haha.
    So you want to add a accelerate down in the player as well :)
  • allc1865allc1865 Member, PRO Posts: 777
    @timolapre1998, hi, thanks for your reply! It helped and I got my character to jump, but the floor goes down. I set up collisions already.
    Thanks!
  • allc1865allc1865 Member, PRO Posts: 777
    The floor goes down as I jump, that is.
  • -Timo--Timo- Member Posts: 2,313
    edited October 2013
    Then go in the floor and put his moveable off (and fixed rotation on) that should work :)
  • allc1865allc1865 Member, PRO Posts: 777
    Yes, those are off.
    I made my background non movable as well.
    When my character goes up, there's a black space under my background, and that's because I didn't stretch my background down that far. When I stretch it down more, the black space goes away because you see my background instead.
    Anyway to fix this?
  • -Timo--Timo- Member Posts: 2,313
    When the floor his moveable is off it cant move. So that is working now?
    I am not sure what your new problem is. Can you try to explain better or maybe post an image/video?
  • KillerPenguinStudiosKillerPenguinStudios Member Posts: 1,291
    Hey @allc1865,
    Kind of confused what your looking for. Sounds like you figured out how to get the black space to go away. What are you you exactly trying to get help with and accomplish???
  • allc1865allc1865 Member, PRO Posts: 777
    Sorry about the link. Which link do you choose to post the pic on the forum?
  • allc1865allc1865 Member, PRO Posts: 777
    But anyway, that black area under my background when my character jumps.
  • -Timo--Timo- Member Posts: 2,313
    You need to post the direct link like this <@img src="directlink"> without @ and "directlink" is the link.
    So image

    Where is your character? Maybe you placed the rules in the background and not in character?
  • allc1865allc1865 Member, PRO Posts: 777
    The character is visible at the moment. But he's in there. When he jumps thats what you see..i want to change that
  • allc1865allc1865 Member, PRO Posts: 777
    invisible, sorry.
  • -Timo--Timo- Member Posts: 2,313
    maybe you want to send the project so I can look at it?
    do you have any rule inside the background?
    are you sure the background his moveable is turned off?
    don't let it collide with the background ;)
    is that black background not a black actor? idk ^^
  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    I have a complete video on how to do run and jump.
  • allc1865allc1865 Member, PRO Posts: 777
    @FryingBaconStudios, thanks, but I'm trying to figure out why a black area is there when I do jump.
  • allc1865allc1865 Member, PRO Posts: 777
    @timolapre1998, I have no rules inside my background; it's not colliding and nothing is colliding with it; I have had moveable on my background checked and unchecked, but I get the same results; the black background is not an actor.
    Thanks for all your help, but if you or anyone doesn't know what could be causing this, I'll figure it out soon enough. Thanks :)
  • KillerPenguinStudiosKillerPenguinStudios Member Posts: 1,291
    @allc1865 I would be willing to take a look at your project as well to see what you have going on. If you want to send either one of us your project, put it in a drop box and PM one of us with the share link to download the project file. I'm sure it's something silly! 8-}
  • -Timo--Timo- Member Posts: 2,313
    Why did you made the player invisible? And where is the floor? Also invisible?
    Are there more actors in the scene that we cant see? Post an image of the rules you have inside your character? Oe just send the file so one of use can look at it ;) you know how? Put it in your dropbox then make it a zip file and send the download link. If you dont know how then watch a video on youtube ;)
  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772
    There are several movement and jumping tutorials available at my website, linked in my signature if you want to take a peek.
  • -Timo--Timo- Member Posts: 2,313
    He fixed the jumping part but he has a new problem ;) still a good tip
  • allc1865allc1865 Member, PRO Posts: 777
    image
    It works!
    But you can't really see it... so, here's the link. Hope you can see it.
    http://imageshack.us/a/img547/1306/146p.png
  • -Timo--Timo- Member Posts: 2,313
    nope I can't see it. but I am glad you fixed it :)
  • allc1865allc1865 Member, PRO Posts: 777
    This is much better.
    image
  • allc1865allc1865 Member, PRO Posts: 777
    The image above is the rules placed in my actor.
Sign In or Register to comment.