Step 2\ Initialize the class.In the first and the second argument,set the position of the gun and in the third argument,the speed.
The default speed is 150,you can increment the value by 100 for more speed.
In the demo,the Xpos and Y pos is the center of the screen,and the speed is 250.

By default,the sprite of the bullet is a circle.You can change the bullet with an image.
Call this function with the path of the image.
If you call without arguments of the image can't be loaded,the bullet is by default a circle.

It's awesome that you are trying to create libraries for everyone to use!

However. I have a few notes.

First of all. Libraries are meant to abstract complex things into simple, reusable and flexible code.
Especially things covered by tutorials with just a few lines of code (let's say less than 200) are probably not terribly helpful for game creation.
Even more so if they are designed around a singular usecase (as in this case. Move sprites towards mouse).

Which leads me to my second point. A projectile library without collision checking is just animating sprites to move somewhere. Not necessarily bad but a very very narrow usecase.

And as last nitpick. The standard for sharing libraries has truly become repositories. You can create repositories for free on GitHub!

It is also good etiquette to add a testing framework, which automatically makes sure the code runs as expected. Ideally integrating it into your repository so every commit you make and every pull request is also automatically checked for problems.

This might be overwhelming at first. And yeah. It is. But using version control (e.g. git and github) is absolutely essential for software development. And relying on the code being functional beyond it running well in a single usecase is obviously also really nice to have when considering to use a library. Busted is a rather widely used testing framework.

The last thing I want to do is discourage you from creating stuff!

But maybe dial down the library threads a bit?

I feel like this subforum should probably host mainly more flexible code. And not necessarily all the functionality that you created while learning.

There's nothing wrong with learning! But not every piece of code is useful for a larger amount of people