コード例 #1
0
        private GameWorld()
        {
            gameobjects = new List<BaseGameEntity>();
            PowerUps = new List<PowerUp>();
            Random rnd = new Random();

            for (int i = 0; i < 10; i++)
            {

            Vehicle vehicle = new Vehicle(new Vector2(rnd.Next(20, 80), rnd.Next(20, 80)));
            vehicle.steeringBehaviour.FleeOn();
            vehicle.steeringBehaviour.SetTarget(new Vector2(400f, 300f));
            vehicle.Mass = 2;
            vehicle.MaxForce = 5;
            vehicle.MaxSpeed = 20;
            gameobjects.Add(vehicle);
            }

            Vehicle vehicle1 = new Vehicle(new Vector2(rnd.Next(20, 80), rnd.Next(20, 80)));
            vehicle1.steeringBehaviour.ExploreOn();
            vehicle1.Mass = 2;
            vehicle1.MaxForce = 5;
            vehicle1.MaxSpeed = 20;
            gameobjects.Add(vehicle1);

            for (int i = 0; i < 3; i++)
            {
                PowerUps.Add(new PowerUp(PowerUp.PowerUpType.Fuel));
                PowerUps.Add(new PowerUp(PowerUp.PowerUpType.Points));
                PowerUps.Add(new PowerUp(PowerUp.PowerUpType.Repair));
            }
        }
コード例 #2
0
        public SteeringBehaviours(Vehicle parent)
        {
            SeekBehaviour = false;
            FleeBehaviour = false;
            ArriveBehaviour = false;
            ExploreBehaviour = false;
            GoalDrivenBehaviour = false;
            this.parent = parent;
            think = new Think(parent);

            exploreTargets = new List<Vector2>();
            exploreTargets.Add(new Vector2(100f,100f));
            exploreTargets.Add(new Vector2(1100f,100f));
            exploreTargets.Add(new Vector2(1100f,200f));
            exploreTargets.Add(new Vector2(100f,200f));
            exploreTargets.Add(new Vector2(100f,300f));
            exploreTargets.Add(new Vector2(1100f,300f));
            exploreTargets.Add(new Vector2(1100f,400f));
            exploreTargets.Add(new Vector2(100f,400f));
            exploreTargets.Add(new Vector2(100f,500f));
            exploreTargets.Add(new Vector2(1100f,500f));
            exploreTargets.Add(new Vector2(1100f,600f));
            exploreTargets.Add(new Vector2(100f,600f));
        }
コード例 #3
0
 public void SetTargetAgent2(Vehicle agent2)
 {
 }
コード例 #4
0
 public void SetTargetAgent1(Vehicle agent1)
 {
 }
コード例 #5
0
ファイル: Game1.cs プロジェクト: arjan9322/IAproject
 public Game1()
 {
     graphics = new GraphicsDeviceManager(this);
     Content.RootDirectory = "Content";
     car = new Vehicle(new Vector2(4f,4f));
 }