Making character jump?
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
-
-Timo- Posts: 2,313
oh haha lolI also downloaded another jumping problem and this one was windows so I thought that was yours
I fixed the problem and added some thing you probably were going to ask later
https://www.dropbox.com/s/u67nw8fzgofd7nv/jumping.gameproj.zip
the problem was in the last rule
I added in otherwise
change self.motion.linear velocity.X to 0 -
-Timo- Posts: 2,313
here is the new download linkhttps://www.dropbox.com/s/wo3us8np0g6hxod/jumping_2.zip
I agree with @fryingbaconstudios. you can learn like this but its not the best way. watch videos or download a full template and try to remake the walking/jumping part.
about your project. make sure you don't mess up self.jumping and game.jumping and make sure every rule does something. now you have if overlaps or collide with and then there was nothing...
maybe you also can use my template
https://www.dropbox.com/s/zvqrpujlvb4okb2/jumping walking and animation template.zip
Answers
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.
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)
✮ FREE templates at GSinvention ✮
✮ Available for hire! support@gsinvention.com ✮
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/
So you want to add a accelerate down in the player as well
✮ FREE templates at GSinvention ✮
✮ Available for hire! support@gsinvention.com ✮
Thanks!
✮ FREE templates at GSinvention ✮
✮ Available for hire! support@gsinvention.com ✮
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?
I am not sure what your new problem is. Can you try to explain better or maybe post an image/video?
✮ FREE templates at GSinvention ✮
✮ Available for hire! support@gsinvention.com ✮
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???
So
Where is your character? Maybe you placed the rules in the background and not in character?
✮ FREE templates at GSinvention ✮
✮ Available for hire! support@gsinvention.com ✮
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 ^^
✮ FREE templates at GSinvention ✮
✮ Available for hire! support@gsinvention.com ✮
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
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
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
✮ FREE templates at GSinvention ✮
✮ Available for hire! support@gsinvention.com ✮
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
✮ FREE templates at GSinvention ✮
✮ Available for hire! support@gsinvention.com ✮
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
✮ FREE templates at GSinvention ✮
✮ Available for hire! support@gsinvention.com ✮