Exemple #1
0
        float start; // collision start

        #endregion Fields

        #region Constructors

        public Player(Game game, ContentManager content, GraphicsDeviceManager graphics, UnitTypes.PlayerType playerType)
            : base(game, content, graphics)
        {
            this.playerType = playerType;
            //heightMapInfo = game.Services.GetService(typeof(HeightMapInfo)) as HeightMapInfo;
            shot = false;

            EnemyCollision = false;
            start = 0;
            //tank.Velocity = 3;
            Velocity = 3;
        }
Exemple #2
0
        public Enemy(Game game, ContentManager content, GraphicsDeviceManager graphics, UnitTypes.EnemyType enemyType, Space space, Vector3 StartingPosition)
            : base(game, content, graphics)
        {
            tank.IsEnemy = true;
            this.enemyType = enemyType;
            this.space = space;
            rotate = Vector3.Zero;
            isHited = false;
            wanderMovesCount = 0;

            tank_box = new Sphere(StartingPosition, 35, 50);//new Box(StartingPosition, 60, 40, 70, 50);
            space.Add(tank_box);
            tank_box.Tag = this;
            tank_box.EventManager.InitialCollisionDetected += tankCollision;
            tank_box.CollisionRules.Group = EnemyTankCollisionGroup;
            this.game = game;

            Velocity = 2;
            tank.Velocity = 10;

            EnemyCannon = new EnemyCannon(game, tank,this);
            EnemyCannonBallManager = new EnemyCannonBallManager(game);
            game.Components.Add(EnemyCannonBallManager);

            randomWanderTarget = Vector3.Zero;
            MaxSteeringForce = 1000;
            WanderOn = true;
            ObstacleAvoidOn = true;
            ChasingOn = false;
            wallAvoidanceOn = true;
            Turn = false;

            FuzzyBrain = new FuzzyEngine();

            SelectedTankParameters = FuzzyBrain.FuzzyParameters;
        }