Help With Gravity & A Jump Function?

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
User avatar
TheP3
Citizen
Posts: 62
Joined: Tue Dec 20, 2011 9:20 pm

Help With Gravity & A Jump Function?

Post by TheP3 »

I made some basic collision detection, however, it's vary buggy... If anyone can help? Great! The way it works is it loads a collision map, black and white. Then, checks for every block if the player collides top, bottom, left, or right. I use a one pixel padding for detection. The core of it is in col.lua. You can look at the other code to if you want. It's all nicely documented.

The bugs are:
If i set the gravity(variable grav in player.lua) any higher, then the player falls into the block making it unable to move... :S
The above problem is what is getting me stuck, and stooping me form making my jump function... I also, would like to know if someone could help me make
a jump function "realistic" (meaning applies physics).

Also, sorry for being a dick and blocking out all the graphics... You can use the code tho :)

TheP3
Attachments
game.love
(11.38 KiB) Downloaded 90 times
I write rules for my computer... I'm not the ruler of the world(yet)... Also, I livestream stuff http://NateAGeek.com/Live
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 156 guests