Jump to content

  • Log In with Google      Sign In   
  • Create Account


#Actualmrmohadnan

Posted 21 May 2013 - 05:58 AM

Oh again brother belfegor thaaaaaaaaaanks  , I tried this code but the enemy move at his place ( no translation is done ! )not move , what  do think belfegor ? 

 

 double distanceX = (double)(cci.CharacterController.Body.Position.X - dwarfChrachterController.Body.Position.X);
            double distanceZ = (double)(cci.CharacterController.Body.Position.Z - dwarfChrachterController.Body.Position.Z);
            if (Math.Sqrt( (distanceX * distanceX) + (distanceZ * distanceZ)) <=500)
            {
                RunController(dwarfAnimatior, dwarfwalk);

                Vector3 direction = cci.CharacterController.Body.Position - dwarfChrachterController.Body.Position;

                Vector3.Normalize(direction);

                dwarfChrachterController.Body.Position += direction * 5 * gameTime.ElapsedGameTime.Seconds;

                if (enemyRay.Intersects(cci.CharacterController.Body.CollisionInformation.BoundingBox) <= 50)
                {
                    sound.playAh();
                }
            }

#3mrmohadnan

Posted 21 May 2013 - 05:58 AM

Oh again brother belfegor thaaaaaaaaaanks  , I tried this code but the enemy move at his place ( not translation is done ! )not move , what  do think belfegor ? 

 

 double distanceX = (double)(cci.CharacterController.Body.Position.X - dwarfChrachterController.Body.Position.X);
            double distanceZ = (double)(cci.CharacterController.Body.Position.Z - dwarfChrachterController.Body.Position.Z);
            if (Math.Sqrt( (distanceX * distanceX) + (distanceZ * distanceZ)) <=500)
            {
                RunController(dwarfAnimatior, dwarfwalk);

                Vector3 direction = cci.CharacterController.Body.Position - dwarfChrachterController.Body.Position;

                Vector3.Normalize(direction);

                dwarfChrachterController.Body.Position += direction * 5 * gameTime.ElapsedGameTime.Seconds;

                if (enemyRay.Intersects(cci.CharacterController.Body.CollisionInformation.BoundingBox) <= 50)
                {
                    sound.playAh();
                }
            }

#2mrmohadnan

Posted 21 May 2013 - 05:57 AM

Oh again brother belfegor thaaaaaaaaaanks  , I tried this code but the enemy dose not move , what  do think belfegor ? 

 

 double distanceX = (double)(cci.CharacterController.Body.Position.X - dwarfChrachterController.Body.Position.X);
            double distanceZ = (double)(cci.CharacterController.Body.Position.Z - dwarfChrachterController.Body.Position.Z);
            if (Math.Sqrt( (distanceX * distanceX) + (distanceZ * distanceZ)) <=500)
            {
                RunController(dwarfAnimatior, dwarfwalk);

                Vector3 direction = cci.CharacterController.Body.Position - dwarfChrachterController.Body.Position;

                Vector3.Normalize(direction);

                dwarfChrachterController.Body.Position += direction * 5 * gameTime.ElapsedGameTime.Seconds;

                if (enemyRay.Intersects(cci.CharacterController.Body.CollisionInformation.BoundingBox) <= 50)
                {
                    sound.playAh();
                }
            }

#1mrmohadnan

Posted 21 May 2013 - 05:55 AM

Oh again brother belfegor thaaaaaaaaaanks  , I tried this code but the enemy dose not move , what  do think belfegor ? 

 

 double distanceX = (double)(cci.CharacterController.Body.Position.X - dwarfChrachterController.Body.Position.X);
            double distanceZ = (double)(cci.CharacterController.Body.Position.Z - dwarfChrachterController.Body.Position.Z);
            if (Math.Sqrt( (distanceX * distanceX) + (distanceZ * distanceZ)) <=500)
            {
                RunController(dwarfAnimatior, dwarfwalk);

                Vector3 direction = cci.CharacterController.Body.Position - dwarfChrachterController.Body.Position;

                //Vector3.Normalize(direction);

                dwarfChrachterController.Body.Position += direction * 5 * gameTime.ElapsedGameTime.Seconds;

                if (enemyRay.Intersects(cci.CharacterController.Body.CollisionInformation.BoundingBox) <= 50)
                {
                    sound.playAh();
                }
            }

PARTNERS