コード例 #1
0
        void MoveToTargetPosition()
        {
            if (this._visualArc)
            {
                long progress = FixedMath.Create(this.AliveTime) / 32;
                long height   = this.arcStartHeight + this.arcStartVerticalSpeed.Mul(progress) - Gravity.Mul(progress.Mul(progress));
                this.Position.z = height;
            }
            else
            {
                this.Position.z = FixedMath.MoveTowards(this.Position.z, TargetHeight, this.linearHeightSpeed);
            }

            LSProjectile.tempDirection = TargetPosition - this.Position.ToVector2d();
            if (LSProjectile.tempDirection.Dot(this.lastDirection.x, this.lastDirection.y) < 0L || tempDirection == Vector2d.zero)
            {
                this.Hit();
            }
            else
            {
                LSProjectile.tempDirection.Normalize();
                Forward                     = tempDirection;
                this.lastDirection          = LSProjectile.tempDirection;
                LSProjectile.tempDirection *= this.speedPerFrame;
                this.Position.Add(LSProjectile.tempDirection.ToVector3d());
            }
        }