Need Explanation On Jumping?
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Need Explanation On Jumping?
I'm new to LOVE Engine and would like to know how to go about making a square jumping by pressing the space bar. Is there a video of it? Any tutorial at all? I can't seem to find much about it.
Re: Need Explanation On Jumping?
First you need to understand what you're doing. The act of jumping is fundamentally going upwards. That is having velocity that is upwards, that continuously affects position, which then also changes to a higher point. So, to jump, you need to give the body upwards velocity. Then, jumping is conventionally impossible without having something to push yourself off of, that is solved with collision detection systems, the object must be in contact with some surface. And finally, you probably need gravity, that is vertical velocity component must continuously increase - as long as the object is in a complete free-fall anyway.
Re: Need Explanation On Jumping?
like raidho36 said, you will need to first understand the basic physics concepts, there's tons of material like this: https://www.youtube.com/watch?v=ZnWP5h69DBM
Re: Need Explanation On Jumping?
Yes, you're in the right direction. I would say jumping is more like throwing a rock - the "initial velocity" determines the high of the throw. As soon as the rock leaves your hand only gravity and air resistance affect its flight.raidho36 wrote:The act of jumping is fundamentally going upwards.
Of course in games there are many additional tricks like double-jumping and jump termination which do not follow the laws of physics:
http://2dengine.com/doc/gs_platformers.html
Re: Need Explanation On Jumping?
So I need to use love.physic? Or is there a different way?
- Positive07
- Party member
- Posts: 1015
- Joined: Sun Aug 12, 2012 4:34 pm
- Location: Argentina
Re: Need Explanation On Jumping?
You need to understand physics, the [wiki]love.physic[/wiki] module already handles all the math so if you use that you need to learn that. But you can do physics without that module. Is just math after all, but if you don't know about this math you can check out the already mentioned tutorials, or use the love.physics module or a similar library (like bump.lua)
for i, person in ipairs(everybody) do
[tab]if not person.obey then person:setObey(true) end
end
love.system.openURL(github.com/pablomayobre)
[tab]if not person.obey then person:setObey(true) end
end
love.system.openURL(github.com/pablomayobre)
- zorg
- Party member
- Posts: 3476
- Joined: Thu Dec 13, 2012 2:55 pm
- Location: Absurdistan, Hungary
- Contact:
Re: Need Explanation On Jumping?
Another good thing one should understand is the difference between how a human would jump, vs. how mario jumps, for instance.
It doesn't take a physics lib to code a more "gameistic" jump solution.
It doesn't take a physics lib to code a more "gameistic" jump solution.
Me and my stuff
True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.

- Sheepolution
- Party member
- Posts: 264
- Joined: Mon Mar 04, 2013 9:31 am
- Location: The Netherlands
- Contact:
Re: Need Explanation On Jumping?
This isn't advice you should give to a beginner, as a 36 minute long video of this can be quite discouraging and makes programming look harder than it is.s-ol wrote:like raidho36 said, you will need to first understand the basic physics concepts, there's tons of material like this: https://www.youtube.com/watch?v=ZnWP5h69DBM
- zorg
- Party member
- Posts: 3476
- Joined: Thu Dec 13, 2012 2:55 pm
- Location: Absurdistan, Hungary
- Contact:
Re: Need Explanation On Jumping?
In my opinion, it can also build character!Sheepolution wrote:This isn't advice you should give to a beginner, as a 36 minute long video of this can be quite discouraging and makes programming look harder than it is.s-ol wrote:like raidho36 said, you will need to first understand the basic physics concepts, there's tons of material like this: https://www.youtube.com/watch?v=ZnWP5h69DBM

But seriously, if i were to ask for help regarding any topic, even if i would receive stuff way above my head, i'd save those reference materials for later when i would understand them. That's just me though.
Me and my stuff
True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.

- RaycatRakittra
- Prole
- Posts: 22
- Joined: Fri Sep 30, 2016 12:40 am
- Location: Chicago, IL
- Contact:
Re: Need Explanation On Jumping?
Agreed. As long as OP knows what jumping looks like and that gravity is a constant pulling force (unless they've disabled it on the ground for some reason), they'll be fine.Sheepolution wrote:This isn't advice you should give to a beginner, as a 36 minute long video of this can be quite discouraging and makes programming look harder than it is.s-ol wrote:like raidho36 said, you will need to first understand the basic physics concepts, there's tons of material like this: https://www.youtube.com/watch?v=ZnWP5h69DBM
Keep at it! You can do it. Study some .love files and emulate how they do things.
EDIT: Try this: http://lovefiddle.com/gAfgmqzs6Ld7gWamf
Courtesy of that LOVE fiddle thread in General.
Sometimes, I can code things.
Who is online
Users browsing this forum: No registered users and 1 guest