Ejemplo n.º 1
0
        public void Fire(Point startLocation, double direction, float maxDistance, PhotonTimeManager photoTimeManager)
        {
            _photonTimeManager = photoTimeManager;

            if (!EnoughTimeHasPassed())
            {
                return;
            }

            _maxDistance      = maxDistance;
            _distanceTraveled = 0;
            _bulletSprite     = new Sprite();
            SoundPlayer player = new SoundPlayer();

            System.IO.Stream         str = Properties.Resources.mySoundFile;
            System.Media.SoundPlayer snd = new System.Media.SoundPlayer(@"C:\Users\keife\Downloads\Backup-20200818T045439Z-001\Backup\GameObjects\380gunshotsinglemikekoenig.wav");
            snd.Play();
            _bulletSprite.Polygon = new[]
            {
                new Point(startLocation.X, startLocation.Y),
                new Point(startLocation.X + 1, startLocation.Y + 1),
                new Point(startLocation.X, startLocation.Y)
            };

            _bulletSprite.Speed = Constants.BulletSpeed;
            _bulletSprite.TravelDirectionInDegrees = direction;
            _location = startLocation;
            _photonTimeManager.SetFired();
        }
Ejemplo n.º 2
0
        public void Fire(Point startLocation, double direction, float maxDistance, PhotonTimeManager photoTimeManager)
        {
            _photonTimeManager = photoTimeManager;

            if(!EnoughTimeHasPassed())
                return;

            _maxDistance = maxDistance;
            _distanceTraveled = 0;
            _bulletSprite = new Sprite();
            _bulletSprite.Polygon = new[]
                                        {
                                            new Point(startLocation.X, startLocation.Y),
                                            new Point(startLocation.X+1, startLocation.Y+1),
                                            new Point(startLocation.X, startLocation.Y)
                                        };

            _bulletSprite.Speed = Constants.BulletSpeed;
            _bulletSprite.TravelDirectionInDegrees = direction;
            _location = startLocation;
            _photonTimeManager.SetFired();
        }
Ejemplo n.º 3
0
        public void Fire(Point startLocation, double direction, float maxDistance, PhotonTimeManager photoTimeManager)
        {
            _photonTimeManager = photoTimeManager;

            if (!EnoughTimeHasPassed())
            {
                return;
            }

            _maxDistance          = maxDistance;
            _distanceTraveled     = 0;
            _bulletSprite         = new Sprite();
            _bulletSprite.Polygon = new[]
            {
                new Point(startLocation.X, startLocation.Y),
                new Point(startLocation.X + 1, startLocation.Y + 1),
                new Point(startLocation.X, startLocation.Y)
            };

            _bulletSprite.Speed = Constants.BulletSpeed;
            _bulletSprite.TravelDirectionInDegrees = direction;
            _location = startLocation;
            _photonTimeManager.SetFired();
        }