diff --git a/js/loadScene.js b/js/loadScene.js index 547b2ad..3cd757d 100644 --- a/js/loadScene.js +++ b/js/loadScene.js @@ -144,8 +144,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); @@ -387,7 +385,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; @@ -408,7 +406,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 36f7c9d..dc7ebeb 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();