BulletMLLib 5.1.0
See the version list below for details.
dotnet add package BulletMLLib --version 5.1.0
NuGet\Install-Package BulletMLLib -Version 5.1.0
<PackageReference Include="BulletMLLib" Version="5.1.0" />
<PackageVersion Include="BulletMLLib" Version="5.1.0" />
<PackageReference Include="BulletMLLib" />
paket add BulletMLLib --version 5.1.0
#r "nuget: BulletMLLib, 5.1.0"
#:package BulletMLLib@5.1.0
#addin nuget:?package=BulletMLLib&version=5.1.0
#tool nuget:?package=BulletMLLib&version=5.1.0
BulletMLLib
A C# library for parsing and executing BulletML XML files. Define complex bullet patterns declaratively in XML and run them in your shmup (shoot-em-up) game.
Based on the implementation by Keiichi Kashihara of Bandle Games.
Features
- Parse BulletML XML documents into executable pattern trees
- All BulletML elements supported: fire, direction, speed, acceleration, repeat, vanish, change direction/speed, and more
- Parameterized references for reusable bullet definitions
- Expression evaluation in node values (
$rank,$rand, custom callbacks) - Configurable time speed (slow-motion) and scale (resize patterns)
- Async update support
Installation
dotnet add package BulletMLLib
Requirements: .NET 8.0+, MonoGame.Framework.DesktopGL 3.8+
Quick Start
1. Implement IBulletManager to handle bullet lifecycle and provide game state:
public class MyBulletManager : IBulletManager
{
public Random Rand { get; } = new Random();
public Dictionary<string, FunctionDelegate> CallbackFunctions { get; } = new();
public FunctionDelegate GameDifficulty { get; set; } = () => 0.5f;
public Vector2 PlayerPosition(IBullet bullet) => _playerPos;
public IBullet CreateBullet() => new MyBullet(this);
public IBullet CreateTopBullet() => new MyBullet(this);
public void RemoveBullet(IBullet bullet) { /* mark inactive */ }
}
2. Inherit from Bullet to provide position storage and bounds checking:
public class MyBullet : Bullet
{
private Vector2 _position;
public override float X { get => _position.X; set => _position.X = value; }
public override float Y { get => _position.Y; set => _position.Y = value; }
public MyBullet(IBulletManager manager) : base(manager) { }
public override void PostUpdate() { /* check bounds, collisions, etc. */ }
}
3. Load a pattern and fire it:
var manager = new MyBulletManager();
var pattern = new BulletPattern(manager);
pattern.ParseXML("patterns/spiral.xml");
var topBullet = manager.CreateTopBullet();
topBullet.X = 400;
topBullet.Y = 100;
topBullet.InitTopNode(pattern.RootNode);
// Each frame:
topBullet.Update();
For a complete working example, see the QuickStart project.
Example BulletML Pattern
A spiral pattern that continuously fires rotating bullets:
<?xml version="1.0"?>
<bulletml type="vertical">
<action label="top">
<repeat>
<times>999</times>
<action>
<fire>
<direction type="sequence">13</direction>
<speed>2</speed>
<bullet />
</fire>
<wait>2</wait>
</action>
</repeat>
</action>
</bulletml>
Documentation
Full documentation is available in the docs folder:
- Getting Started -- step-by-step integration guide
- API Reference -- classes, interfaces, enums, and properties
- BulletML Pattern Guide -- writing BulletML XML scripts
- Architecture -- library internals and design
The wiki is also a useful reference for writing BulletML scripts.
Resources
- BulletML Specification -- original language spec by ABA Games
- BulletML Examples -- collection of open-source BulletML patterns
- QuickStart Project -- minimal working example
License
MIT
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- Equationator (>= 5.0.0)
- Vector2Extensions (>= 5.0.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on BulletMLLib:
| Package | Downloads |
|---|---|
|
BulletCircus
MonoGame library game that mixes BulletML with flocking and collision detection |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 5.1.4 | 97 | 10/2/2026 |
| 5.1.3 | 113 | 9/28/2026 |
| 5.1.2 | 96 | 9/28/2026 |
| 5.1.1 | 96 | 9/28/2026 |
| 5.1.0 | 96 | 9/28/2026 |
| 5.0.0 | 197 | 1/27/2026 |
| 2.0.5 | 1,373 | 7/7/2021 |
| 2.0.4 | 1,215 | 7/1/2021 |
| 2.0.2 | 1,190 | 4/27/2021 |
| 2.0.1 | 1,509 | 3/5/2020 |
| 2.0.0 | 1,607 | 5/6/2019 |
| 1.0.8 | 2,294 | 2/20/2018 |
| 1.0.7 | 2,118 | 12/3/2017 |
| 1.0.5 | 1,977 | 11/30/2017 |
| 1.0.4 | 2,178 | 12/24/2016 |
| 1.0.3 | 2,129 | 9/5/2016 |
| 1.0.2 | 2,089 | 9/4/2016 |
5.1.0
BREAKING: patterns are now validated against the BulletML DTD rules, so some patterns that loaded in 5.0 will throw from ParseXML. Errors are InvalidDataException, wrapped in an exception naming the file.
- Elements in places the DTD doesn't allow are rejected.
- Required children are enforced: changeSpeed needs speed and term, changeDirection needs direction and term, accel needs term, repeat needs times plus an action or actionRef.
- Invalid, misspelled or misplaced type attributes are rejected. A direction with a bad type is no longer silently treated as aim.
- actionRef, bulletRef and fireRef must have a label.
- BulletPattern.MyValidationEventHandler has been removed.
Fixed:
- Bullets that fire themselves (recursive bulletRef) no longer crash with a stack overflow.
- Circular actionRef chains are reported as an error instead of overflowing the stack.
- A fire node with no bullet or bulletRef reports which node is broken, instead of throwing a NullReferenceException.
- speed, horizontal and vertical now default to absolute, as the spec says.
Full release notes: https://github.com/dmanning23/BulletMLLib/blob/master/CHANGELOG.md