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.

DarkBASIC Professional Discussion / Help with physics for a small game.

Author
Message
ScottieBro
16
Years of Service
User Offline
Joined: 14th Dec 2009
Location:
Posted: 1st Feb 2011 02:22
Yes, I'm trying to make a program that is like moon patrol.

I want to move a moon buggy over a terrain and be able to jump over craters.

How would I simulate the physics over the terrain when it encounters
inclines and declines?

I'd like to keep it as least complacated as possiable.

Also how would it fall into craters?

Can anyone help or give me some pointers on how I can implament this?

Thanks,
Peace,
and
Out!

Jinkcy Cat
BillR
23
Years of Service
User Offline
Joined: 19th Mar 2003
Location: United States
Posted: 1st Feb 2011 11:29 Edited at: 1st Feb 2011 11:30
One answer is to purchase a physics plugin for DBPro from TGC like Box2D, it will do everything you want it to.
This would give you maximum quality for 2D physics.
It cost $30 US, but it is really impressive.
There is a learning curve to use it, but there are people here to help you as well as sample code and tutorials.
Maybe more complicated than you were hoping for, but you are wanting to do a complicated terrain following game, so this may be your best option.
BatVink
Moderator
23
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 1st Feb 2011 14:55
Another option is to code it yourself using vectors. I did this for a spaceship-based game, where using thrusters changed the direction over time, which is what you need.

There is a tutorial somewhere by Philip on vectors. It used to be hosted by Kentaree, but it's gone from his site now. Maybe somebody will see this and know where it is.

My personal approach would be Box2D

Diggsey
20
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 1st Feb 2011 18:28 Edited at: 1st Feb 2011 18:28
There is a demo which comes with Box2D which is similar to what you're trying to acheive:



You will probably want suspension though if it is a moon buggy, so you'll need to make a few extra joints, but it should give you a starting point.

[b]
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 1st Feb 2011 21:03
@Diggsey

Welcome to the club by the way. Long overdue.

Login to post a reply

Server time is: 2026-07-18 05:04:49
Your offset time is: 2026-07-18 05:04:49