protected internal override void Move()
        {
            Rotation = _player.Rotation;

            Axes2D  axes      = new Axes2D(new Point2D(0, 0), _player.Rotation);
            Point2D shotPoint = new Point2D(_player.Pivot.X, _player.Pivot.Y);

            shotPoint += axes.Y * _padding;

            base.Move(shotPoint - Pivot);
        }
示例#2
0
        public Bullet FireWithBullet(float speed, float padding)
        {
            if (IsReadyToFire)
            {
                Axes2D  axes      = new Axes2D(new Point2D(0, 0), _player.Rotation);
                Point2D shotPoint = new Point2D(_player.Pivot.X, _player.Pivot.Y);
                shotPoint += axes.Y * padding;
                Bullet b = new Bullet(_bulletPoints, shotPoint);
                b.Speed = speed;
                b.Rotate(_player.Rotation);
                b.LifeTime    = _bulletLifeTime;
                IsReadyToFire = false;
                return(b);
            }

            return(null);
        }
示例#3
0
        public Laser FireWithLaser(float padding)
        {
            if (IsReadyToFire && AvaibleLaserShots > 0)
            {
                Axes2D  axes      = new Axes2D(new Point2D(0, 0), _player.Rotation);
                Point2D shotPoint = new Point2D(_player.Pivot.X, _player.Pivot.Y);
                shotPoint += axes.Y * padding;
                Laser laser = new Laser(_laserPoints, shotPoint, _player, padding);
                laser.LifeTime = _laserLifeTime;
                laser.Rotate(_player.Rotation);
                IsReadyToFire = false;
                AvaibleLaserShots--;
                LaserValueChanged?.Invoke(this, AvaibleLaserShots);
                return(laser);
            }

            return(null);
        }
        protected internal override void Move()
        {
            Axes2D axes = new Axes2D(new Point2D(0, 0), Rotation);

            base.Move(axes.Y * base.Speed);
        }
示例#5
0
        public void MoveForward(int lifetime)
        {
            Axes2D axes = new Axes2D(new Point2D(0, 0), Rotation);

            _accelerationsController.AddAcceleration(axes.Y, Speed, lifetime);
        }