Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change image type #1

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/chapter05/MaterialLighting.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public void simpleInitApp() {
Material rockMat = new Material(assetManager,
"Common/MatDefs/Light/Lighting.j3md");
rockMat.setTexture("DiffuseMap", assetManager.loadTexture(
"Textures/Pebbles/Pebbles_diffuse.jpg"));
"Textures/Pebbles/Pebbles_diffuse.png"));
rockMat.setTexture("NormalMap", assetManager.loadTexture(
"Textures/Pebbles/Pebbles_normal.png"));

Expand Down
43 changes: 25 additions & 18 deletions src/chapter06/PhysicsTown.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,15 @@ public class PhysicsTown extends SimpleApplication implements ActionListener {
private boolean rotateLeft = false, rotateRight = false,
strafeLeft = false, strafeRight = false,
forward = false, backward = false;
private float speed=8;
private float speed=8f;
private CameraNode camNode;

public static void main(String[] args) {
PhysicsTown app = new PhysicsTown();
app.start();
}

@Override
public void simpleInitApp() {
initPhysics();
initLight();
Expand Down Expand Up @@ -138,24 +139,30 @@ private void initNavigation() {
* No walking happens here yet -- we only keep track of
* the direction the user wants to go.
*/
@Override
public void onAction(String binding, boolean isPressed, float tpf) {
if (binding.equals("Rotate Left")) {
rotateLeft = isPressed;
} else if (binding.equals("Rotate Right")) {
rotateRight = isPressed;
} else
if (binding.equals("Strafe Left")) {
strafeLeft = isPressed;
} else if (binding.equals("Strafe Right")) {
strafeRight = isPressed;
} else
if (binding.equals("Forward")) {
forward = isPressed;
} else if (binding.equals("Back")) {
backward = isPressed;
} else
if (binding.equals("Jump")) {
playerControl.jump();
switch (binding) {
case "Rotate Left":
rotateLeft = isPressed;
break;
case "Rotate Right":
rotateRight = isPressed;
break;
case "Strafe Left":
strafeLeft = isPressed;
break;
case "Strafe Right":
strafeRight = isPressed;
break;
case "Forward":
forward = isPressed;
break;
case "Back":
backward = isPressed;
break;
case "Jump":
playerControl.jump();
break;
}
}

Expand Down