MissileSharp is a .NET library to control an USB Missile Launcher.
For now it supports only one model, the Dream Cheeky Thunder, as this is the only one I own.
(I'm in Germany, and I bought my missile launcher from a German shop...but it seems to be the exact same model as the Dream Cheeky Thunder.)
You can either download MissileSharp from the download page on Bitbucket (link above) or install with NuGet:
The control software that came with the missile launcher is not needed at all.
Just connect the device to your machine, and Windows should automatically recognize it. That's enough for MissileSharp to control it.
How to use
The main class of MissileSharp is the
It has only one constructor, which expects a parameter of the type
ILauncherModel - these are the settings for the different missile launcher models.
(As MissileSharp only supports one model at the moment, you can only pass a
ThunderMissileLauncher for now)
var launcher = new CommandCenter(new ThunderMissileLauncher());
There are three different types of commands:
- Move (
Move the launcher in the specified direction
Reset to known position (move to bottom left)
Fire some missiles
You can use these commands as methods of the
launcher.Reset(); // reset to bottom left launcher.Right(1000); // turn right 1000 milliseconds launcher.Up(500); // move up 500 milliseconds launcher.Fire(2); // fire 2 missiles
This is also available as a fluent interface:
Executing sequences of commands
Instead of directly calling the methods, you can also pass a complete sequence of commands at once as an
LauncherCommand consists of a command string (e.g.
fire - exactly the same commands as explained above) and a numeric parameter (for either the duration or the number of shots).
The following code does the same as the previous example, but uses a
List<LauncherCommand> instead of directly calling
var commands = new List<LauncherCommand>(); commands.Add(new LauncherCommand("reset", 0)); commands.Add(new LauncherCommand("right", 1000)); commands.Add(new LauncherCommand("up", 500)); commands.Add(new LauncherCommand("fire", 2)); launcher.RunCommandSet(commands);
MissileSharp supports loading command sets from a config file as well.
A config file with the commands from the examples above would look like this:
[Steve] reset,0 right,1000 up,500 fire,2
You can save several of these command sets in the same file, each one under its own name (in this case, "Steve").
First, you have to load the file once:
After that, you can execute any of the command sets by referring to the name:
launcher.RunCommandSet("Steve"); // shoot Steve
How to build
build.bat in the main folder. This will create a new folder named
release with the compiled assembly.
build-release.bat to create a NuGet package and a zip file (all in the
release folder) as well.
MissileSharp makes use of the following open source projects:
MissileSharp is licensed under the MIT License. See License.txt for details.