예제 #1
0
        private Vector2 randomizeVector(clsRoadWorld world, Vector2 location)
        {
            int   variant = 16;
            float modX    = world.random.Next(variant * 2) - variant;
            float modY    = world.random.Next(variant * 2) - variant;

            return(new Vector2(location.X + modX, location.Y + modY));
        }
예제 #2
0
        public clsEntry(string textureName, Vector2 location, Vector2 direction, clsRoadWorld worldToSpawnIn, string spawnTypeName, int maxSpawnTime) : base(textureName, location, direction, new Vector2(0, 0))
        {
            base.typeName           = "entry";
            base.collisionDetection = CollisionType.None;
            this.spawnTypeName      = spawnTypeName;
            this.maxSpawnTime       = maxSpawnTime;
            this.worldToSpawnIn     = worldToSpawnIn;

            // add min spawn time later
            this.nextSpawnTime = worldToSpawnIn.random.Next(maxSpawnTime);
        }
예제 #3
0
        float speedComplianceVariationPercentage; // faster or slower than normal. (e.g. 10% slower than normal)

        public clsDriverAI(clsRoadWorld world, clsCar car, Vector2 destination) : base(world, car)
        {
            // inputs
            this.car            = car;
            this.destination    = destination;
            this.yieldStartTime = 0;

            // calculate route
            calculateShortestRoute(car.location, destination);

            // driver differences
            //speedRangePercentage = (car.world.random.Next(10) - 5) / 100.0f;
            //speedComplianceVariationPercentage = (car.world.random.Next(10) - 5) / 100.0f;

            // start timer
            this.lastUpdated = world.currentTime;
        }
예제 #4
0
 public void removeGameObject(clsRoadWorld world, clsObject worldObject)
 {
     world.remove((intObject)worldObject);
 }