コード例 #1
0
        public void Fire()
        {
            ResolveResourcesIfNeeded();

                BaseBullet baseBullet = new PlayerBullet(new Vector3(ParentShip.Rotation.X + Rotation.X, 0, ParentShip.Rotation.Z + Rotation.Z));
                //Matrix rotationMatrix = Matrix.CreateFromYawPitchRoll(ParentShip.Rotation.Y + Rotation.Y, ParentShip.Rotation.X + Rotation.X, ParentShip.Rotation.Z + Rotation.Z);

                baseBullet.Position = ParentShip.TotalPosition; //+ Vector3.Transform(Position, rotationMatrix);
                _gameState.PlayerBullets.Add(baseBullet);
                Random r = new Random();

                FireSound.Play((float)r.NextDouble() / 2 + 0.5f, 0.5f - (float)(r.NextDouble()), 0f);
        }
コード例 #2
0
 public IEnumerable<Resource> ResourcePaths()
 {
     BaseBullet baseBullet = new PlayerBullet();
     IEnumerable<Resource> resources = baseBullet.ResourcePaths();
     return resources.Concat(new Resource[]{new Resource("Audio/Weapons/laser-zap-01", typeof (SoundEffect))});
 }