How do I make my player jump. I know I need x and y axis but how do I actually make the player go up a certain height and then come back down.
Thanks for your help in advance
Jumping
- Robin
- The Omniscient
- Posts: 6506
- Joined: Fri Feb 20, 2009 4:29 pm
- Location: The Netherlands
- Contact:
Re: Jumping
There are a million ways to do that, and which ones work best depends on how the rest of your code is structured, and we can give you in the mean time is some vague ideas or examples.
Do you have gravity already? Half of jumping is falling, and it will be easier if your player already can fall of things.
Also, you need to keep track of whether the player is currently jumping, and the time the jump still has left (because jumping usually takes time, otherwise it looked like the player teleported up rather than jumped).
Do you have gravity already? Half of jumping is falling, and it will be easier if your player already can fall of things.
Also, you need to keep track of whether the player is currently jumping, and the time the jump still has left (because jumping usually takes time, otherwise it looked like the player teleported up rather than jumped).
Help us help you: attach a .love.
Re: Jumping
Thank You. I'm new to love2d so im really bad at it.
Re: Jumping
Sorry if anyone is finding this topic annoying. I don't know how to delete posts
Re: Jumping
use the love.physics tutorial.
https://www.love2d.org/wiki/Category:Tutorials
https://www.love2d.org/wiki/Tutorial:Physics
https://www.love2d.org/wiki/Category:Tutorials
https://www.love2d.org/wiki/Tutorial:Physics
Lua is not an acronym.
Re: Jumping
Thank youqaisjp wrote:use the love.physics tutorial.
https://www.love2d.org/wiki/Category:Tutorials
https://www.love2d.org/wiki/Tutorial:Physics
Who is online
Users browsing this forum: Ahrefs [Bot], Google [Bot] and 2 guests