Esempio n. 1
0
        public override bool Strike(IPlayer player)
        {
            _player                     = player;
            _shooter                    = player;
            _playerImage                = player.ShooterImage;
            _allTargets                 = player.GetAllEnemies();
            _storedArrowKeyDirection    = player.ShootingDirection_Player;
            AllImagesShootingArrowLeft  = player.AllArrowShootingLeftImages;
            AllImagesShootingArrowRight = player.AllArrowShootingRightImages;

            IsWeaponReadyForStrike = true;
            var initialLocationPoint = new Point(_arrowShootingInitialPotitionX, _arrowShootingInitialPotitionY);

            switch (_storedArrowKeyDirection)
            {
            case Key.Left:
                var shootingLeftInitialLocationSuccess = _weaponHelper.SetInitialLocation_For_ShootingWeapon(_playerImage, initialLocationPoint, AllImagesShootingArrowLeft);
                return(shootingLeftInitialLocationSuccess);

            case Key.Right:
                var shootingRightInitialLocationSuccess = _weaponHelper.SetInitialLocation_For_ShootingWeapon(_playerImage, initialLocationPoint, AllImagesShootingArrowRight);
                return(shootingRightInitialLocationSuccess);
            }
            return(false);
        }
Esempio n. 2
0
        public bool Strike(IEnemy shooter)
        {
            IsWeaponReadyToStrike = true;
            _enemy = shooter;
            _allTargets.Add(shooter.Target);
            AllImagesShootingLeftWeapon  = shooter.AllFireballLeftShootingImages;
            AllImagesShootingRightWeapon = shooter.AllFireballRightShootingImages;
            var initialLocationPoint = new Point(0, 0);

            //... here we have to make them left and righ weapons
            var shootingLeftInitialLocationSuccess  = _weaponHelper.SetInitialLocation_For_ShootingWeapon(shooter.ShooterImage, initialLocationPoint, AllImagesShootingLeftWeapon);
            var shootingRightInitialLocationSuccess = _weaponHelper.SetInitialLocation_For_ShootingWeapon(shooter.ShooterImage, initialLocationPoint, AllImagesShootingRightWeapon);

            if (shootingLeftInitialLocationSuccess && shootingRightInitialLocationSuccess)
            {
                return(true);
            }
            return(false);
        }