예제 #1
0
        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();
        }
예제 #2
0
        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;
        }
예제 #3
0
        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;
        }