1
0
mirror of https://github.com/Dejvino/roadtrip synced 2024-11-21 15:32:35 +00:00

Added a fence made in Blender as a static object.

This commit is contained in:
Dejvino 2016-12-31 16:58:13 +01:00
parent da8c1e6bc7
commit 17cecdcf2b
7 changed files with 22 additions and 2 deletions

View File

@ -6,11 +6,14 @@ A game about a journey involving vehicles and obstacles.
## Status
### DONE
* Physics-based vehicle
* Driving controls (UHJKM)
* Camera following the player
* Hilly ground
* Collidable objects (testing)
* Collidable objects - static and dynamic
### TODO
* Orbit camera
* Rigid objects (fences, houses)
* People
* Walking around - NPCs
* Walking around - Player
* Enter / Exit a car

Binary file not shown.

BIN
assets/Models/fence.j3o Normal file

Binary file not shown.

View File

@ -0,0 +1,3 @@
#
#Sat Dec 31 15:42:32 CET 2016
ORIGINAL_PATH=Models/fence.scene

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 910 KiB

After

Width:  |  Height:  |  Size: 938 KiB

View File

@ -72,12 +72,14 @@ public class RoadTrip extends SimpleApplication implements ActionListener {
inputManager.addMapping("Rights", new KeyTrigger(KeyInput.KEY_K));
inputManager.addMapping("Ups", new KeyTrigger(KeyInput.KEY_U));
inputManager.addMapping("Downs", new KeyTrigger(KeyInput.KEY_J));
inputManager.addMapping("Revs", new KeyTrigger(KeyInput.KEY_M));
inputManager.addMapping("Space", new KeyTrigger(KeyInput.KEY_SPACE));
inputManager.addMapping("Reset", new KeyTrigger(KeyInput.KEY_RETURN));
inputManager.addListener(this, "Lefts");
inputManager.addListener(this, "Rights");
inputManager.addListener(this, "Ups");
inputManager.addListener(this, "Downs");
inputManager.addListener(this, "Revs");
inputManager.addListener(this, "Space");
inputManager.addListener(this, "Reset");
}
@ -255,6 +257,18 @@ public class RoadTrip extends SimpleApplication implements ActionListener {
}
vehicle.brake(0, b);
vehicle.brake(1, b);
} else if (binding.equals("Revs")) {
if (value) {
accelerationValue += accelerationForce;
} else {
accelerationValue -= accelerationForce;
}
vehicle.accelerate(2, -accelerationValue);
vehicle.accelerate(3, -accelerationValue);
if (carType == TRUCK) {
vehicle.accelerate(4, -accelerationValue);
vehicle.accelerate(5, -accelerationValue);
}
} else if (binding.equals("Space")) {
if (value) {
vehicle.applyImpulse(jumpForce, Vector3f.ZERO);