diff --git a/js/loadScene.js b/js/loadScene.js index 6020986..4d9d5c7 100644 --- a/js/loadScene.js +++ b/js/loadScene.js @@ -143,8 +143,6 @@ require([ z2.aIComponent.addBehavior({name:"Zombie-Idle", update:ZombieIdle}, 0); z2.aIComponent.addBehavior({name:"Zombie-PathFind", update:ZombiePathFind}, 1); // z2.addToWorld(); - Game.zombie = zombie; - Game.zombieRoot = zombie.transformComponent.parent.entity; //console.log(navRef); @@ -386,7 +384,7 @@ require([ node.doorPos = navMesh.room[entity.room].door[node.curNode.door].center; entity.aIComponent.setActiveByName("Zombie-Idle", false); node.state = 1; - var eac = Game.zombieRoot.animationComponent; + var eac = entity.transformComponent.parent.entity.animationComponent; eac.transitionTo( eac.getStates()[1]); } break; @@ -407,7 +405,7 @@ require([ node.doorPos = navMesh.room[entity.room].door[node.curNode.door].center; entity.aIComponent.setActiveByName("Zombie-Idle", false); node.state = 1; - var eac = Game.zombieRoot.animationComponent; + var eac = entity.transformComponent.parent.entity.animationComponent; eac.transitionTo( eac.getStates()[1]); } else{ diff --git a/lib/FPSCamComponent.js b/lib/FPSCamComponent.js index f2996ac..1f39fa3 100644 --- a/lib/FPSCamComponent.js +++ b/lib/FPSCamComponent.js @@ -29,7 +29,7 @@ define([ var entityTransform; var cam; var camTransform; - var speed = 5; + var speed = 10; var tmpVec = new Vector3(); var fwdBase = new Vector3(0,0,-1); var leftBase = new Vector3(-1,0,0); @@ -53,7 +53,7 @@ define([ this.type = "FPSCamComponent"; //entity = entityRef; entityTransform = Game.userEntity.transformComponent.transform; - cam = EntityUtils.createTypicalEntity(Game.goo.world, new Camera(45, 1.0, 0.01, 100)); + cam = EntityUtils.createTypicalEntity(Game.goo.world, new Camera(45, 1.0, 0.01, 130)); Game.viewCam = cam; camTransform = cam.transformComponent.transform; cam.addToWorld();