Skip to content

Commit

Permalink
Added first head lamp model (looks bad)
Browse files Browse the repository at this point in the history
  • Loading branch information
DomenicDev committed Jun 12, 2017
1 parent 9739192 commit 9bb14a4
Show file tree
Hide file tree
Showing 10 changed files with 32 additions and 7 deletions.
4 changes: 4 additions & 0 deletions assets/Materials/Headlamp/Headlamp.j3m
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Material My Material : Common/MatDefs/Light/Lighting.j3md {
MaterialParameters {
}
}
Binary file added assets/Models/Headlamp/Headlamp.j3o
Binary file not shown.
3 changes: 3 additions & 0 deletions assets/Models/Headlamp/Headlamp.j3odata
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#
#Mon Jun 12 11:49:29 CEST 2017
ORIGINAL_PATH=Models/Headlamp/blender2ogre-export.scene
Binary file modified assets/Models/Player/Player.j3o
Binary file not shown.
Binary file modified assets/Scenes/BeachScene.j3o
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
import java.util.HashMap;

/**
* This state holds a map of {@link GameCommander}s with their playerId as key. This
* state is used for easier access.
* Created by Domenic on 08.06.2017.
*/
public class GameCommanderHolder extends AbstractAppState {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,13 @@ private void equipToPlayer(EntityId playerId, EntityId itemToEquip) {

Model modelType = equipables.getEntity(itemToEquip).get(Model.class);

if (modelType.getPath().equals(ModelType.Flashlight)) {
if (modelType.getPath().equals(ModelType.Headlamp)) {

// attach to head
Node attachmentNode = playerModel.getControl(SkeletonControl.class).getAttachmentsNode("Head");
Node itemNode = new Node("ItemNode");
attachmentNode.attachChild(itemNode);
itemNode.setLocalTranslation(0, 0, 0);
itemNode.setLocalTranslation(-0.011107027f, 0.09165355f, 0.12990493f);

// attachmentNode.attachChild(itemModel);
itemNode.attachChild(itemModel);
Expand Down
2 changes: 1 addition & 1 deletion src/de/gamedevbaden/crucified/enums/ModelType.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class ModelType {
public static final String TriggerableDoor = "Models/TriggerableDoor.j3o";
public static final String Door = "Models/Door.j3o";
public static final String TestPickup = "Models/PickableItem.j3o";
public static final String Flashlight = "Models/Flashlight/TestFlashLight.j3o";
public static final String Headlamp = "Models/Headlamp/Headlamp.j3o";
/*
TestScene("Models/Plane.j3o"),
TestTerrain("Scenes/Terrains/TestTerrain.j3o"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,11 @@ public void messageReceived(Client source, Message m) {
}

if (m instanceof ReadNoteMessage) {
ReadNoteMessage rm = (ReadNoteMessage) m;
gameCommander.readNote(rm.getScript());
this.app.enqueue(() -> {
ReadNoteMessage rm = (ReadNoteMessage) m;
gameCommander.readNote(rm.getScript());
return null;
});
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,13 @@
import de.gamedevbaden.crucified.utils.GameOptions;

/**
* A simple server test application for testing in game features.
*
* Created by Domenic on 26.04.2017.
*/
public class ServerTest extends SimpleApplication {

float time;
private float time;
private EntityId cube;
private EntityData entityData;

Expand All @@ -40,22 +42,33 @@ public void simpleInitApp() {
setPauseOnLostFocus(false);
GameOptions.ENABLE_PHYSICS_DEBUG = true; // for now

// this state will create an own EntityData which we can use
EntityDataState entityDataState = new EntityDataState();
stateManager.attach(entityDataState);

// get self-created entity data
entityData = entityDataState.getEntityData();

// responsible for creating game sessions for connected players
GameSessionManager gameSessionManager = new GameSessionManager();
stateManager.attach(gameSessionManager);

stateManager.attach(new GameServer(5555));
// create and setup game server
GameServer server = new GameServer(5555);
server.setAmountOfUpdatesPerSecond(10);
stateManager.attach(server);

// attach the default GameEventHandler
stateManager.attach(new GameEventHandler(gameSessionManager));

// this state just holds the server side commanders
stateManager.attach(new GameCommanderHolder());

// inits game logic states
GameInitializer.initEssentialAppStates(stateManager);
GameInitializer.initGameLogicAppStates(stateManager);

// load scene
stateManager.attach(new SceneEntityLoader());


Expand Down

0 comments on commit 9bb14a4

Please sign in to comment.