From afebe1c573b51dda74e2ab8e1f7de9682b3f9632 Mon Sep 17 00:00:00 2001 From: Raymond Hulha Date: Fri, 22 Nov 2013 13:40:53 +0100 Subject: [PATCH] small improvements --- js/loadScene.js | 6 ++---- lib/FPSCamComponent.js | 4 ++-- 2 files changed, 4 insertions(+), 6 deletions(-) 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();