public LaunchedBomb(Point location, Direction direction) { switch (direction) { case Direction.Up: _sprite = ProjectileSpriteFactory.Instance.CreateBombUp(); break; case Direction.Down: _sprite = ProjectileSpriteFactory.Instance.CreateBombDown(); break; case Direction.Left: _sprite = ProjectileSpriteFactory.Instance.CreateBombLeft(); break; case Direction.Right: _sprite = ProjectileSpriteFactory.Instance.CreateBombRight(); break; default: throw new ArgumentOutOfRangeException(); } _launchedBombStateMachine = new BasicProjectileStateMachine(location, direction, LaunchedBombSpeed); SoundEffectManager.Instance.PlayBombExplode(); }
public Arrow(Point location, Direction direction) { SoundEffectManager.Instance.PlayArrowShoot(); switch (direction) { case Direction.Up: _sprite = ProjectileSpriteFactory.Instance.CreateArrowUp(); break; case Direction.Down: _sprite = ProjectileSpriteFactory.Instance.CreateArrowDown(); break; case Direction.Left: _sprite = ProjectileSpriteFactory.Instance.CreateArrowLeft(); break; case Direction.Right: _sprite = ProjectileSpriteFactory.Instance.CreateArrowRight(); break; default: throw new ArgumentOutOfRangeException(); } _arrowStateMachine = new BasicProjectileStateMachine(location, direction, ArrowSpeed); Halted = false; }
public SwordBeam(Point location, Direction direction, int damage) { switch (direction) { case Direction.Up: _sprite = ProjectileSpriteFactory.Instance.CreateSwordBeamUp(); break; case Direction.Down: _sprite = ProjectileSpriteFactory.Instance.CreateSwordBeamDown(); break; case Direction.Left: _sprite = ProjectileSpriteFactory.Instance.CreateSwordBeamLeft(); break; case Direction.Right: _sprite = ProjectileSpriteFactory.Instance.CreateSwordBeamRight(); break; default: throw new ArgumentOutOfRangeException(); } _swordBeamStateMachine = new BasicProjectileStateMachine(location, direction, SwordBeamSpeed); _damage = damage; }