# Examples of vehicle games

I’ve been following forum posts and using TestFancyCar + TestPhysicsCar, but I can’t get the wheels to work / vehicle to move properly / models to load with collision detection at all times.

Also, I want to program an aircraft, but don’t know where to start. The physics doesn’t have to be great, just needs acceleration.

Any examples I can use for inspiration for aircrafts & vehicles?

1 Like

Not a game, but should be helpful:

Yes (and I should have specified) but I’d like to use the native physics libraries & i dont want to use any extra classes – above is good but uses alot of extra classes

1 Like

jme-vehicles uses native physics. Why don’t you want extra classes?

I don’t have alot of time to learn how the classes work (because there is a deadline I have to meet)-- I would love to use more but I’ve already studied VehicleControl + javadoc and so it would be alot easier for me to implement something with those

1 Like

This is all you need for a fully working vehicles library wrapping the bullet classes:

``````dependencies {
implementation 'com.github.stephengold:MaVehicles:0.6.1+for33'
implementation 'com.github.stephengold:Minie:4.1.0+for33'
}
``````

It’s just the core library, not a whole game to learn. I use it in my project. works extremely well and easy to use.

2 Likes

Regarding the aircraft, maybe just setting the RigidBodyControl’s linear velocity in the forward direction will be enough for you:

``````float velocity=5.0f;
RigidBodyControl ctl = [find your RigidBodyControl];
Vector3f forward = [your node containing the above RigidBodyControl].getLocalRotation().mult(Vector3f.UNIT_Z);
ctl.setLinearVelocity(forward.mult(velocity.floatValue()));
``````
1 Like

What are you doing differently from TestFancyCar?

For flight simulation, see

1 Like

I am using a different model.

Also @sgold is there a .jar file for MavCommon (the one with the examples)?
I cannot use gradle for my project.

Vehicles using jme base classes (Minie) + Nitros + jump forces :

Main code :

Linear Nitro :

Effect :

You can do both of them in the same class

Please donot copy those classes, use them as a reference because there are android parts embedded at the top, you will get red lines if you do on jme SDK.

Let us know what are the specifications you want to add to your vehicles…other than aircrafts…

There’s no MavCommon JAR available for download, but you could easily build one, by cloning the repo and executing the Gradle wrapper:

``````sgold:~/Git/jme-vehicles\$ ./gradlew :MavCommon:jar
Starting a Gradle Daemon (subsequent builds will be faster)

BUILD SUCCESSFUL in 29s
sgold:~/Git/jme-vehicles\$ ls MavCommon/build/libs
MavCommon.jar
sgold:~/Git/jme-vehicles\$
``````

Thank you @sgold @Pavl_G. Sorry for the late reply.

I will implement this in my project. Are there any projects of vehicle control / simple projects (no extra libraries) that can drive vehicles?

Thanks!

1 Like

The jme3-examples project includes 4 very simple applications involving vehicles: `TestAttachDriver`, `TestFancyCar`, `TestPhysicsCar`, and `TestHoveringTank`.

https://github.com/jMonkeyEngine/jmonkeyengine/tree/master/jme3-examples/src/main/java/jme3test/bullet