Exemple #1
0
 public WanderBehavior(WarZGame game, AiPlayer player)
     : base(game, player)
 {
     _wanderDirection.X = (float)Math.Cos(player.FacingDirection);
     _wanderDirection.Z = (float)Math.Sin(player.FacingDirection);
     player.FullSpeed = true;
 }
Exemple #2
0
 public CanonManager(WarZGame game)
     : base(game)
 {
     WZGame = game;
     _balls = new List <CanonBall>(MAX_BALLS);
     fillCanon();
 }
Exemple #3
0
 public CollisionSystem(WarZGame game, Player player, AiPlayerManager aiManager)
     : base(game)
 {
     _player = player;
     _aiM = aiManager;
     WZGame = game;
 }
Exemple #4
0
        public Tank(WarZGame game, Model model)
            : base(game, model)
        {
            WZGame = game;

            // _scale /= 300;
            _model.Root.Transform *= Matrix.CreateScale(Vector3.One / 300);
            _model.Root.Transform *= Matrix.CreateRotationY(MathHelper.Pi);

            _boneTransforms = new Matrix[_model.Bones.Count];
            _model.CopyAbsoluteBoneTransformsTo(_boneTransforms);

            LoadBoundingSphere();

            leftBackWheelBone = model.Bones["l_back_wheel_geo"];
            rightBackWheelBone = model.Bones["r_back_wheel_geo"];
            leftFrontWheelBone = model.Bones["l_front_wheel_geo"];
            rightFrontWheelBone = model.Bones["r_front_wheel_geo"];
            turretBone = model.Bones["turret_geo"];
            canonBone = model.Bones["canon_geo"];

            leftBackWheelTransform = leftBackWheelBone.Transform;
            rightBackWheelTransform = rightBackWheelBone.Transform;
            leftFrontWheelTransform = leftFrontWheelBone.Transform;
            rightFrontWheelTransform = rightFrontWheelBone.Transform;

            turretTransform = turretBone.Transform;
            canonTransform = turretBone.Transform;

            _specularColor_original = ((BasicEffect)(_model.Meshes[0].Effects[0])).SpecularColor;
            _specularColor_red = Color.Red.ToVector3();
        }
Exemple #5
0
 public CollisionSystem(WarZGame game, Player player, AiPlayerManager aiManager)
     : base(game)
 {
     _player = player;
     _aiM    = aiManager;
     WZGame  = game;
 }
Exemple #6
0
        public ParticlesManager(WarZGame game)
            : base(game)
        {
            WZGame = game;

            explosionParticles       = new ExplosionParticleSystem(WZGame);
            explosionSmokeParticles  = new ExplosionSmokeParticleSystem(WZGame);
            projectileTrailParticles = new ProjectileTrailParticleSystem(WZGame);
            smokePlumeParticles      = new SmokePlumeParticleSystem(WZGame);
            fireParticles            = new FireParticleSystem(WZGame);

            // Set the draw order so the explosions and fire
            // will appear over the top of the smoke.
            smokePlumeParticles.DrawOrder      = 150;
            explosionSmokeParticles.DrawOrder  = 200;
            projectileTrailParticles.DrawOrder = 300;
            explosionParticles.DrawOrder       = 400;
            fireParticles.DrawOrder            = 500;

            // Register the particle system WZGame.Components.
            WZGame.Components.Add(explosionParticles);
            WZGame.Components.Add(explosionSmokeParticles);
            WZGame.Components.Add(projectileTrailParticles);
            WZGame.Components.Add(smokePlumeParticles);
            WZGame.Components.Add(fireParticles);
        }
Exemple #7
0
        public ParticlesManager(WarZGame game)
            : base(game)
        {
            WZGame = game;

            explosionParticles = new ExplosionParticleSystem(WZGame);
            explosionSmokeParticles = new ExplosionSmokeParticleSystem(WZGame);
            projectileTrailParticles = new ProjectileTrailParticleSystem(WZGame);
            smokePlumeParticles = new SmokePlumeParticleSystem(WZGame);
            fireParticles = new FireParticleSystem(WZGame);

            // Set the draw order so the explosions and fire
            // will appear over the top of the smoke.
            smokePlumeParticles.DrawOrder = 150;
            explosionSmokeParticles.DrawOrder = 200;
            projectileTrailParticles.DrawOrder = 300;
            explosionParticles.DrawOrder = 400;
            fireParticles.DrawOrder = 500;

            // Register the particle system WZGame.Components.
            WZGame.Components.Add(explosionParticles);
            WZGame.Components.Add(explosionSmokeParticles);
            WZGame.Components.Add(projectileTrailParticles);
            WZGame.Components.Add(smokePlumeParticles);
            WZGame.Components.Add(fireParticles);
        }
Exemple #8
0
 public AiPlayerManager(WarZGame game, Tank tank)
     : base(game)
 {
     _aiPlayers   = new List <AiPlayer>(MAX_AI);
     this.WZGame  = game;
     _defaultTank = tank;
 }
Exemple #9
0
 public WanderBehavior(WarZGame game, AiPlayer player)
     : base(game, player)
 {
     _wanderDirection.X = (float)Math.Cos(player.FacingDirection);
     _wanderDirection.Z = (float)Math.Sin(player.FacingDirection);
     player.FullSpeed   = true;
 }
Exemple #10
0
 public AiPlayerManager(WarZGame game, Tank tank)
     : base(game)
 {
     _aiPlayers = new List<AiPlayer>(MAX_AI);
     this.WZGame = game;
     _defaultTank = tank;
 }
Exemple #11
0
        public Tank(WarZGame game, Model model)
            : base(game, model)
        {
            WZGame = game;

            // _scale /= 300;
            _model.Root.Transform *= Matrix.CreateScale(Vector3.One / 300);
            _model.Root.Transform *= Matrix.CreateRotationY(MathHelper.Pi);

            _boneTransforms = new Matrix[_model.Bones.Count];
            _model.CopyAbsoluteBoneTransformsTo(_boneTransforms);

            LoadBoundingSphere();


            leftBackWheelBone   = model.Bones["l_back_wheel_geo"];
            rightBackWheelBone  = model.Bones["r_back_wheel_geo"];
            leftFrontWheelBone  = model.Bones["l_front_wheel_geo"];
            rightFrontWheelBone = model.Bones["r_front_wheel_geo"];
            turretBone          = model.Bones["turret_geo"];
            canonBone           = model.Bones["canon_geo"];

            leftBackWheelTransform   = leftBackWheelBone.Transform;
            rightBackWheelTransform  = rightBackWheelBone.Transform;
            leftFrontWheelTransform  = leftFrontWheelBone.Transform;
            rightFrontWheelTransform = rightFrontWheelBone.Transform;

            turretTransform = turretBone.Transform;
            canonTransform  = turretBone.Transform;


            _specularColor_original = ((BasicEffect)(_model.Meshes[0].Effects[0])).SpecularColor;
            _specularColor_red      = Color.Red.ToVector3();
        }
Exemple #12
0
 public CanonManager(WarZGame game)
     : base(game)
 {
     WZGame = game;
     _balls = new List<CanonBall>(MAX_BALLS);
     fillCanon();
 }
Exemple #13
0
        public static void Initialize(WarZGame game)
        {
            if (initialized)
                return;

            _game = game;
            initialized = true;
        }
Exemple #14
0
        public AiPlayer(WarZGame game, Camera camera, Tank tank, Terrain terrain, int id)
            : base(game, camera, tank, terrain)
        {
            WZGame = game;
            Behaviors = new List<AiPlayerBehavior>(MAX_BEHAVIORS);
            MaxSpeed = 5f;

            this.id = id;
        }
Exemple #15
0
        public CanonBall(WarZGame game)
            : base(game)
        {
            WZGame = game;
            _ball = new SpherePrimitive(game.GraphicsDevice, Diameter, Tesselation);
            _boundingSphere = new BoundingSphere(_position, Diameter / 2f);

            _soundExplode = WZGame.Content.Load<SoundEffect>("Sounds/canon - explode2");
        }
Exemple #16
0
        public AiPlayer(WarZGame game, Camera camera, Tank tank, Terrain terrain, int id)
            : base(game, camera, tank, terrain)
        {
            WZGame    = game;
            Behaviors = new List <AiPlayerBehavior>(MAX_BEHAVIORS);
            MaxSpeed  = 5f;

            this.id = id;
        }
Exemple #17
0
        public static void Initialize(WarZGame game)
        {
            if (initialized)
            {
                return;
            }

            _game       = game;
            initialized = true;
        }
Exemple #18
0
        public CanonBall(WarZGame game)
            : base(game)
        {
            WZGame = game;
            _ball = new SpherePrimitive(game.GraphicsDevice, Diameter, Tesselation);
            _boundingSphere = new BoundingSphere(_position, Diameter / 2f);

            _soundExplode = WZGame.Content.Load<SoundEffect>("Sounds/canon - explode2");

        }
Exemple #19
0
        public Player(WarZGame game, Camera camera, Tank tank, Terrain terrain)
            : base(game)
        {
            WZGame = game;
            _mesh  = tank;

            _terrain = terrain;

            ChangeCamera(camera);

            _canonManager = new CanonManager(game);

            _soundFire                    = WZGame.Content.Load <SoundEffect>("Sounds/tank - shoot");
            _soundTankGo                  = WZGame.Content.Load <SoundEffect>("Sounds/tank - go");
            _soundTankGoInstance          = _soundTankGo.CreateInstance();
            _soundTankGoInstance.IsLooped = true;
            // _camera.HorizontalOffset = 4f;
        }
Exemple #20
0
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        static void Main(string[] args)
        {
            /*
               www

            Thread liveDebugger = new Thread(StartLiveDebugger);
            liveDebugger.IsBackground = true;
            liveDebugger.SetApartmentState(ApartmentState.STA);
            liveDebugger.Start();

            while (!LDbg.Initialized) ;
            */

            using (WarZGame game = new WarZGame())
            {
                game.Run();
            }
        }
Exemple #21
0
        public Player(WarZGame game, Camera camera, Tank tank, Terrain terrain)
            : base(game)
        {
            WZGame = game;
            _mesh = tank;

            _terrain = terrain;

            ChangeCamera(camera);

            _canonManager = new CanonManager(game);

            _soundFire = WZGame.Content.Load<SoundEffect>("Sounds/tank - shoot");
            _soundTankGo = WZGame.Content.Load<SoundEffect>("Sounds/tank - go");
            _soundTankGoInstance = _soundTankGo.CreateInstance();
            _soundTankGoInstance.IsLooped = true;
            // _camera.HorizontalOffset = 4f;
        }
Exemple #22
0
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        static void Main(string[] args)
        {
            /*
             * www
             *
             *
             * Thread liveDebugger = new Thread(StartLiveDebugger);
             * liveDebugger.IsBackground = true;
             * liveDebugger.SetApartmentState(ApartmentState.STA);
             * liveDebugger.Start();
             *
             *
             *
             *
             * while (!LDbg.Initialized) ;
             */

            using (WarZGame game = new WarZGame())
            {
                game.Run();
            }
        }
Exemple #23
0
 public ExplosionSmokeParticleSystem(WarZGame game)
     : base(game)
 {
 }
Exemple #24
0
 public GodViewCamera(WarZGame game, Vector3 position, Vector3 target, Vector3 up)
     : base(game, position, target, up)
 {
     WZGame = game;
 }
Exemple #25
0
 public ChaseBehavior(WarZGame game, AiPlayer aiPlayer, Player player)
     : base(game, aiPlayer)
 {
     _aiPlayer.FullSpeed = true;
     _player             = player;
 }
 public ProjectileTrailParticleSystem(WarZGame game)
     : base(game)
 {
 }
 public ExplosionParticleSystem(WarZGame game)
     : base(game)
 {
     WZGame = game;
 }
 public SmokePlumeParticleSystem(WarZGame game)
     : base(game)
 {
 }
 public ExplosionParticleSystem(WarZGame game)
     : base(game)
 {
     WZGame = game;
 }
 public ExplosionSmokeParticleSystem(WarZGame game)
     : base(game)
 {
 }
Exemple #31
0
 public AiPlayerBehavior(WarZGame game, AiPlayer player)
 {
     _aiPlayer = player;
     WZGame    = game;
     _enabled  = true;
 }
 public SmokePlumeParticleSystem(WarZGame game)
     : base(game)
 {
 }
Exemple #33
0
 /// <summary>
 /// Constructor.
 /// </summary>
 protected ParticleSystem(WarZGame game)
     : base(game)
 {
     WZGame = game;
 }
Exemple #34
0
 public FireParticleSystem(WarZGame game)
     : base(game)
 {
 }
Exemple #35
0
 public GodViewCamera(WarZGame game, Vector3 position, Vector3 target, Vector3 up)
     : base(game, position, target, up)
 {
     WZGame = game;
 }
Exemple #36
0
 /// <summary>
 /// Constructor.
 /// </summary>
 protected ParticleSystem(WarZGame game)
     : base(game)
 {
     WZGame = game;
 }
 public GoingForwardBehavior(WarZGame game, AiPlayer aiPlayer)
     : base(game, aiPlayer)
 {
     aiPlayer.FullSpeed = true;
 }
 public ProjectileTrailParticleSystem(WarZGame game)
     : base(game)
 {
 }
Exemple #39
0
 public ChaseBehavior(WarZGame game, AiPlayer aiPlayer, Player player)
     : base(game,aiPlayer)
 {
     _aiPlayer.FullSpeed = true;
     _player = player;
 }
Exemple #40
0
 public FireParticleSystem(WarZGame game)
     : base(game)
 {
 }
Exemple #41
0
 public AiPlayerBehavior(WarZGame game, AiPlayer player)
 {
     _aiPlayer = player;
     WZGame = game;
     _enabled = true;
 }
 public GoingForwardBehavior(WarZGame game, AiPlayer aiPlayer)
     : base(game, aiPlayer)
 {
     aiPlayer.FullSpeed = true;
 }