Example #1
0
 private void initialize(double spread, ILocationEquation center, ILocationEquation left, ILocationEquation right)
 {
     this.center = center;
     this.left   = left;
     this.right  = right;
     this.spread = spread;
 }
Example #2
0
 public Piece(ILocationEquation equation, long duration, double angleOffset, double speed)
 {
     this.equation    = equation;
     this.duration    = duration;
     this.angleOffset = angleOffset;
     this.speed       = speed;
 }
Example #3
0
        public Path makePath(Vector2 startLocation, PathData pathData)
        {
            ILocationEquation locationEquation = getEquation(pathData.equationType);
            Path p = new BasicPath(locationEquation, startLocation, pathData.angleOffset, pathData.speed);

            return(p);
        }
Example #4
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="locationEquation"> The ILocationEquation to use to update the location</param>
        /// <param name="initialLocation"> The starting location of the object</param>
        /// <param name="AngleOffset"> The input angle should be in radians and will go clockwise starting in the x direction</param>

        public BasicPath(ILocationEquation locationEquation, Vector2 initialLocation, double AngleOffset, double speedRatio = 1)
        {
            _locationEquation = locationEquation;
            _speedRatio       = speedRatio;
            _initialLocation  = initialLocation;
            Offset            = initialLocation - locationEquation.GetLocation(0);
            this.AngleOffset  = AngleOffset;
            StartTime         = Clock.getClock().getTime();
        }
Example #5
0
        public BasicPath(BasicPath path, Vector2 initialLocation, double AngleOffset, double speedRatio = 1)
        {
            _locationEquation = path._locationEquation;
            _speedRatio       = speedRatio;

            Offset = initialLocation - _locationEquation.GetLocation(0);

            this.AngleOffset = AngleOffset;

            this.StartTime = Clock.getClock().getTime();
        }
Example #6
0
        public Path makePath(Vector2 startLocation, List <PathData> pathData)
        {
            PiecewisePath p = new PiecewisePath(startLocation);

            foreach (var pData in pathData)
            {
                ILocationEquation equation = getEquation(pData.equationType);
                p.AddToPath(equation, pData.pathDuration, pData.angleOffset, pData.speed);
            }
            return(p);
        }
Example #7
0
 public ShotgunBulletFactory(double spread, ILocationEquation center, ILocationEquation left, ILocationEquation right)
 {
     initialize(spread, center, left, right);
 }
Example #8
0
 public ShotgunBulletFactory(double spread, ILocationEquation general)
 {
     initialize(spread, general, general, general);
 }
Example #9
0
        /// <summary>
        /// Adds onto the end of the path.
        /// </summary>
        /// <param name="equation"></param> Equation that will be used during it's time period.
        /// <param name="duration"></param> How long the path should be used for.
        /// <param name="angleOffset"></param> Angle in radians.
        /// <param name="speed"></param> Speed ratio, 1 is normal speed.
        public void AddToPath(ILocationEquation equation, long duration, double angleOffset, double speed)
        {
            Piece p = new Piece(equation, duration, angleOffset, speed);

            pieces.AddLast(p);
        }
 public SingleBulletFactory(ILocationEquation pathToFollow)
 {
     this.path   = pathToFollow;
     this.width  = width;
     this.height = height;
 }
Example #11
0
        /*
         *  TODO: IMPLEMEMENT GUN TO FOLLOW SPECIFIC SHAPE/PATTERN EQUATION
         */
        public BossGun(Vector2 startingLoc, int delay, BulletFactory factory, float direction, ILocationEquation shape, Texture2D texture, TEAM team) : base(delay, texture, factory, team)
        {
            Location             = startingLoc;
            this.delay           = delay;
            this.bfactory        = factory;
            this.direction       = direction;
            base.fireAngleOffset = Math.PI / 2;

            path = (SpiralLocationEquation)shape;
        }
 public MovingBulletFactory(BulletFactory bulletFactory, ILocationEquation pathToFollow)
 {
     this.pathLocationEquation = pathToFollow;
     this.path          = new BasicPath(pathToFollow, Vector2.Zero, 0, 1);
     this.bulletFactory = bulletFactory;
 }
 public RotatedLocationEquation(ILocationEquation locationEquation, double angle)
 {
     this.equation = locationEquation;
     this.angle    = angle;
 }
 public BulletCollidingBullet(int damage, ILocationEquation locationEquation, Texture2D texture, Vector2 startLocation, TEAM team) : base(damage, locationEquation, texture, startLocation, team)
 {
 }