/// <summary>
        /// Initialize the projectile event.
        /// </summary>
        /// <param name="timeline">The timeline this event is part of.</param>
        /// <param name="start">The start of the event.</param>
        /// <param name="dependentOn">An optional event to be dependent upon, ie. wait for.</param>
        /// <param name="position">The starting position of the projectile.</param>
        /// <param name="destination">The destination point of the projectile.</param>
        protected virtual void Initialize(Timeline timeline, float start, TimelineEvent dependentOn, Vector2 position, Destination destination)
        {
            //Call the base method.
            base.Initialize(timeline, start, dependentOn);

            //Initialize the variables.
            _Position = position;
            _Destination = destination;
            _Projectile = new FlameProjectile(_Position, _Destination);

            //Subscribe to the projectile's collision event.
            _Projectile.OnCollision += OnProjectileCollided;
        }
Example #2
0
 /// <summary>
 /// Initialize the projectile.
 /// </summary>
 /// <param name="position">The starting position of the projectile.</param>
 /// <param name="destination">The projectile's destination.</param>
 protected virtual void Initialize(Vector2 position, Destination destination)
 {
     //Initialize some fields.
     _Sprite = new SpriteManager();
     _Position = position;
     _Destination = destination;
     _Velocity = new Vector2();
 }
 /// <summary>
 /// Constructor for a projectile event.
 /// </summary>
 /// <param name="timeline">The timeline this event is part of.</param>
 /// <param name="start">The start of the event.</param>
 /// <param name="dependentOn">An optional event to be dependent upon, ie. wait for.</param>
 /// <param name="position">The starting position of the projectile.</param>
 /// <param name="destination">The destination point of the projectile.</param>
 public ProjectileEvent(Timeline timeline, float start, TimelineEvent dependentOn, Vector2 position, Destination destination)
 {
     Initialize(timeline, start, dependentOn, position, destination);
 }
 /// <summary>
 /// Constructor for a flame projectile.
 /// </summary>
 /// <param name="position">The starting position of the projectile.</param>
 /// <param name="destination">The destination of this projectile.</param>
 public FlameProjectile(Vector2 position, Destination destination)
 {
     Initialize(position, destination);
 }