Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Code Snippets / [Dark GDK] Simulation of Gravity

Author
Message
silenus
15
Years of Service
User Offline
Joined: 4th Mar 2009
Location:
Posted: 15th Mar 2009 11:55
Hi folks,
finaly I solved the problem with the gravity. Sydbod helped me very much, without him I wouldn't reached the goal to set up al little gravity. Thank you Sydbod.

The idea is to meassure the terrainheight of 8 points arround the player. Calculate the difference between these points an decide whether the player is effected or not. To visualize what the code is doing, I put a cube as marker for the lower ground and a cone for the hihger ground in place. And 8 spheres to mark all meassure points.

Take look:
http://img25.imageshack.us/my.php?image=unbenanntghz.jpg
And I finaly managed to implement jumping.
The code is a littlebit confusing. And poorly commented. But it works neary but not perfect. I atteched my map and other files u may need. And here is the code:



And here you can see some "work in progress":

http://forum.thegamecreators.com/?m=forum_view&t=146877&b=22
silenus
15
Years of Service
User Offline
Joined: 4th Mar 2009
Location:
Posted: 15th Mar 2009 11:58
damit, I forgot the map

Attachments

Login to view attachments

Login to post a reply

Server time is: 2024-05-02 09:27:37
Your offset time is: 2024-05-02 09:27:37