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 / Vehicle Controls with Physics - DBPro 5.9 Beta 3 Only

Author
Message
the Last Programmer
19
Years of Service
User Offline
Joined: 14th Jul 2005
Location: Abilene, TX
Posted: 10th Nov 2005 03:24
Hi,

I was just messing with the new ODE commands and came up with a vehicle movement code. I hope you enjoy it. Use the arrow keys to move the box around.



I don't really want to explain everything, but I will describe to you the ODE commands.

ODE SET LINEAR VELOCITY objNum, x#, y#, Z#

This command apparantly moves the object in the specified x,y,z direction you want. Similar to position object, except with a physics enabled twist.

ODE SET ANGULAR VELOCITY 2, 0, 2, 0

This command apparantly just rotates the object in any x,y,z angle you want. Similar to rotate object, except with a physics enabled twist.

These two commands are central to the movement of the vehicle demonstrated in my code.

I hope to be back with more soon.

go to my website to download cool new games:

www.fishbrosentertainment.com
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 10th Nov 2005 11:20
Nice. I did a similar thing as a test for myself with Newton.

To take this a step further, you could load a model for a landscape with bumps etc. Or add some static boxes at different angles. With a bit more velocity, it will take off, skid and other fantastic things, with no extra code!

By the way, you have fallen in to the trap that I did. You use "..." at the end of comments. That won't compile for people using the default editor.

Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 12th Nov 2005 18:45
It wont work for me, it highlights line 20 (the one that says "make object box 1") and sys the object doesn't exist :S


the Last Programmer
19
Years of Service
User Offline
Joined: 14th Jul 2005
Location: Abilene, TX
Posted: 12th Nov 2005 22:23
Hi,

Here's an executable that I made. Enjoy!

go to my website to download cool new games:

www.fishbrosentertainment.com

Attachments

Login to view attachments
Ryan
18
Years of Service
User Offline
Joined: 29th Nov 2005
Location:
Posted: 29th Nov 2005 23:35
Hi all this is the first time I have entered a question into the Forum. I know this question is not about your code, but it seemed relavent since you are playing with ODE. I am trying to make a board game. I have the board developed in ODE so it will react with other objects. My problem is making dice. I made the cubes and the graphics, but I cannot get the individual Bitmaps attached to each side. It will use one bitmap for all sides though. If anyone has some ideas on how to help fix this, Please do!
Thanks Ryan
the Last Programmer
19
Years of Service
User Offline
Joined: 14th Jul 2005
Location: Abilene, TX
Posted: 28th Dec 2005 01:02
Hi, Ryan. I didn't see your post until now, so I don't know if you you have recieved an answer to your question or not.

I think the easiest remedy to your problem is to make a cube in a modeling program and then create a UV Texture for the cube. This way, you will have complete control over what goes on each side of your cube.

You can use Wings 3D for free, or even Blender 3D. Those are two exceptional free modeling programs that don't cost you anything but time to learn.

Falling dice for a board game sounds like a good idea for adding physics to your game. I would like to see that in action. If you have anything complete then please give us an executable.

Thanks


www.fishbrosentertainment.com
Rockdrala
18
Years of Service
User Offline
Joined: 15th Dec 2005
Location:
Posted: 29th Dec 2005 16:55
ok how do i add this to FPSC.. I have visual studio, i dont mind decompiling and recompiling...

Vlad
19
Years of Service
User Offline
Joined: 5th Oct 2005
Location:
Posted: 29th Dec 2005 17:02
This is DB or DBP ( I never know ). You will have to put that code inside the FPSC source code and apply it to the object you'd want. Then the cameras, etc.

Compile to the new FPSC-Game.exe and you are ready to go.

I'm pretty sure I know everything. Doubts are something rare in me and I am never wrong, as this signature can prove.
Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 29th Dec 2005 18:11
I wouldn't exactly call that vehicle controls, because vehicles can't turn when they're not moving but good demo anyway.

TKsFox
18
Years of Service
User Offline
Joined: 25th Nov 2005
Location: No no no - Its not the Cyberspace
Posted: 29th Dec 2005 19:31
What Zotoaster said - it isnt really a car...

But hey - it rox if u name it hovercraft controls
(still searching a gd and easy car physic )

It's me...
the Last Programmer
19
Years of Service
User Offline
Joined: 14th Jul 2005
Location: Abilene, TX
Posted: 30th Dec 2005 07:39 Edited at: 30th Dec 2005 07:40
Hi, then you can play my game "Physics Playground" which features better vehicle physics and controls.

I have attached an executable for your enjoyment. Or you can search for it in the program announcement section under "Physics Playground".

http://forum.thegamecreators.com/?m=forum_view&t=65284&b=5


Here's some pics:





I also released the source code for that game if you want my updated functions.

Thanks.


www.fishbrosentertainment.com

Attachments

Login to view attachments

Login to post a reply

Server time is: 2024-11-23 07:44:46
Your offset time is: 2024-11-23 07:44:46