private void shootBullet() { if (_aimDirection == PlayerDirection.up) { recoil(_aimDirection); } else if (_aimDirection == PlayerDirection.down) { recoil(_aimDirection); } else if (_aimDirection == PlayerDirection.left) { recoil(_aimDirection); } else if (_aimDirection == PlayerDirection.right) { recoil(_aimDirection); } PlayerBullet bullet = new PlayerBullet(_aimDirection, _level); _level.AddChild(bullet); bullet.SetXY(x, y - (height / 2)); }
private void shootBullet() { if (aimDirection == PlayerDirection.up) { recoil(aimDirection); } else if (aimDirection == PlayerDirection.down) { recoil(aimDirection); } else if (aimDirection == PlayerDirection.left) { recoil(aimDirection); } else if (aimDirection == PlayerDirection.right) { recoil(aimDirection); } PlayerBullet bullet = new PlayerBullet(aimDirection, _level); _level.backgroundLayer.AddChild(bullet); bullet.SetXY(x, y - (height / 2)); SoundChannel soundChannel = new SoundChannel(2); Sound shootsound = new Sound("shoot.wav"); shootsound.Play(false, 2); _level.thisgame.shakeScreen(); }