Browse Source

Added a fence made in Blender as a static object.

master
Dejvino 7 years ago
parent
commit
17cecdcf2b
7 changed files with 22 additions and 2 deletions
  1. +5
    -2
      README.md
  2. BIN
      assets-src/Models/fence.blend
  3. BIN
      assets/Models/fence.j3o
  4. +3
    -0
      assets/Models/fence.j3odata
  5. BIN
      assets/Scenes/TestMap.j3o
  6. BIN
      screenshot.png
  7. +14
    -0
      src/roadtrip/RoadTrip.java

+ 5
- 2
README.md View File

@@ -6,11 +6,14 @@ A game about a journey involving vehicles and obstacles.
## Status ## Status
### DONE ### DONE
* Physics-based vehicle * Physics-based vehicle
* Driving controls (UHJKM)
* Camera following the player * Camera following the player
* Hilly ground * Hilly ground
* Collidable objects (testing)
* Collidable objects - static and dynamic


### TODO ### TODO
* Orbit camera * Orbit camera
* Rigid objects (fences, houses)
* People * People
* Walking around - NPCs
* Walking around - Player
* Enter / Exit a car

BIN
assets-src/Models/fence.blend View File


BIN
assets/Models/fence.j3o View File


+ 3
- 0
assets/Models/fence.j3odata View File

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

BIN
assets/Scenes/TestMap.j3o View File


BIN
screenshot.png View File

Before After
Width: 1026  |  Height: 795  |  Size: 910 KiB Width: 1026  |  Height: 795  |  Size: 938 KiB

+ 14
- 0
src/roadtrip/RoadTrip.java View File

@@ -72,12 +72,14 @@ public class RoadTrip extends SimpleApplication implements ActionListener {
inputManager.addMapping("Rights", new KeyTrigger(KeyInput.KEY_K)); inputManager.addMapping("Rights", new KeyTrigger(KeyInput.KEY_K));
inputManager.addMapping("Ups", new KeyTrigger(KeyInput.KEY_U)); inputManager.addMapping("Ups", new KeyTrigger(KeyInput.KEY_U));
inputManager.addMapping("Downs", new KeyTrigger(KeyInput.KEY_J)); 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("Space", new KeyTrigger(KeyInput.KEY_SPACE));
inputManager.addMapping("Reset", new KeyTrigger(KeyInput.KEY_RETURN)); inputManager.addMapping("Reset", new KeyTrigger(KeyInput.KEY_RETURN));
inputManager.addListener(this, "Lefts"); inputManager.addListener(this, "Lefts");
inputManager.addListener(this, "Rights"); inputManager.addListener(this, "Rights");
inputManager.addListener(this, "Ups"); inputManager.addListener(this, "Ups");
inputManager.addListener(this, "Downs"); inputManager.addListener(this, "Downs");
inputManager.addListener(this, "Revs");
inputManager.addListener(this, "Space"); inputManager.addListener(this, "Space");
inputManager.addListener(this, "Reset"); inputManager.addListener(this, "Reset");
} }
@@ -255,6 +257,18 @@ public class RoadTrip extends SimpleApplication implements ActionListener {
} }
vehicle.brake(0, b); vehicle.brake(0, b);
vehicle.brake(1, 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")) { } else if (binding.equals("Space")) {
if (value) { if (value) {
vehicle.applyImpulse(jumpForce, Vector3f.ZERO); vehicle.applyImpulse(jumpForce, Vector3f.ZERO);


Loading…
Cancel
Save