/// <summary> /// /// </summary> /// <param name="initialFacingDirection"></param> /// <param name="attackAnims">The order of the animations: North, South, East</param> /// <param name="walkAnims">The order of the animations: North, South, East</param> /// <param name="projectileAnims">The order of the animations: North, South, East</param> public GameActor( Game game, CardinalDirection initialFacingDirection, AnimatedSprite[] attackAnims, AnimatedSprite[] walkAnims, AnimatedSprite[] projectileAnims) : this(game) { if ( attackAnims != null && attackAnims.Length == 3 ) { AttackNorthAnim = attackAnims[0]; AttackSouthAnim = attackAnims[1]; AttackEastAnim = attackAnims[2]; } if ( walkAnims != null && walkAnims.Length == 3 ) { WalkNorthAnim = walkAnims[0]; WalkSouthAnim = walkAnims[1]; WalkEastAnim = walkAnims[2]; } if ( projectileAnims != null && projectileAnims.Length == 3 ) { ProjectileNorthAnim = projectileAnims[0]; ProjectileSouthAnim = projectileAnims[1]; ProjectileEastAnim = projectileAnims[2]; } FacingDirection = initialFacingDirection; ReplaceCurrentAnimation( ); }
public AnimatedSprite( AnimatedSprite other ) { _texture = other._texture; _sourceRectangle = other._sourceRectangle; _fps = other._fps; _increment = other._increment; _totalElapsed = other._totalElapsed; Finished = other.Finished; FrameBoundingBox = other.FrameBoundingBox; }
public Enemy( Enemy other ) : base(other._game) { FacingDirection = other.FacingDirection; IsEnemy = true; if ( other.AttackEastAnim != null ) AttackEastAnim = new AnimatedSprite( other.AttackEastAnim ); if ( other.AttackNorthAnim != null ) AttackNorthAnim = new AnimatedSprite( other.AttackNorthAnim ); if ( other.AttackSouthAnim != null ) AttackSouthAnim = new AnimatedSprite( other.AttackSouthAnim ); if ( other.WalkEastAnim != null ) WalkEastAnim = new AnimatedSprite( other.WalkEastAnim ); if ( other.WalkNorthAnim != null ) WalkNorthAnim = new AnimatedSprite( other.WalkNorthAnim ); if ( other.WalkSouthAnim != null ) WalkSouthAnim = new AnimatedSprite( other.WalkSouthAnim ); if ( other.ProjectileEastAnim != null ) ProjectileEastAnim = new AnimatedSprite( other.ProjectileEastAnim ); if ( other.ProjectileNorthAnim != null ) ProjectileNorthAnim = new AnimatedSprite( other.ProjectileNorthAnim ); if ( other.ProjectileSouthAnim != null ) ProjectileSouthAnim = new AnimatedSprite( other.ProjectileSouthAnim ); ReplaceCurrentAnimation( ); }
public Enemy( Game game, CardinalDirection initialFacingDirection, AnimatedSprite[] attackAnims, AnimatedSprite[] walkAnims, AnimatedSprite[] projectileAnims) : base(game, initialFacingDirection, attackAnims, walkAnims, projectileAnims) { IsEnemy = true; }
public Player( Game parent, CardinalDirection initialFacingDirection, AnimatedSprite[] attackAnims, AnimatedSprite[] walkAnims, AnimatedSprite[] projectileAnims) : base(parent, initialFacingDirection, attackAnims, walkAnims, projectileAnims) { _projectilesShot = new Queue<Projectile>( ); }