FsBulletML2.TypeProviders 1.0.1

dotnet add package FsBulletML2.TypeProviders --version 1.0.1
                    
NuGet\Install-Package FsBulletML2.TypeProviders -Version 1.0.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="FsBulletML2.TypeProviders" Version="1.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="FsBulletML2.TypeProviders" Version="1.0.1" />
                    
Directory.Packages.props
<PackageReference Include="FsBulletML2.TypeProviders" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add FsBulletML2.TypeProviders --version 1.0.1
                    
#r "nuget: FsBulletML2.TypeProviders, 1.0.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package FsBulletML2.TypeProviders@1.0.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=FsBulletML2.TypeProviders&version=1.0.1
                    
Install as a Cake Addin
#tool nuget:?package=FsBulletML2.TypeProviders&version=1.0.1
                    
Install as a Cake Tool

FsBulletML2

A BulletML engine written in F#. It runs danmaku (bullet-hell) patterns frame by frame and leaves drawing, collision and object pooling to your game framework: MonoGame, Unity, Godot or anything that can call .NET.

Package What it does
FsBulletML2.Core The engine. Loads a pattern and steps one bullet per call
FsBulletML2.Parser Reads patterns written in XML, SXML or FSB
FsBulletML2.Front Shared front-end layer that drives many bullets per frame
FsBulletML2.Dsl Computation expressions for writing patterns in F#
FsBulletML2.TypeProviders Type providers that turn an XML, SXML or FSB pattern into a typed value at compile time

Core, Front and Dsl target net10.0 and netstandard2.1 (Unity). Parser and TypeProviders target net10.0.

Run a pattern

F#

open FsBulletML2
open FsBulletML2.Domain

let xml = """<bulletml xmlns="http://www.asahi-net.or.jp/~cs8k-cyu/bulletml">
  <action label="top">
    <fire><direction type="absolute">0</direction><speed>2</speed><bullet/></fire>
    <wait>1</wait>
    <vanish/>
  </action>
</bulletml>"""

let rand () = 0.5f
let rank = 0.5f

// Load once per pattern
let script = Runner.load rand rank (readXmlString xml)
let mutable run = Runner.newRoot BulletType.Enemy script
let mutable pos = { X = 0.0f; Y = 0.0f }

// Step once per frame
for _ in 1..3 do
    let env =
        { Rand = rand
          Rank = rank
          Aim = { ToPlayer = 0.0f; ToEnemy = 0.0f }
          Spawn = { ToPlayer = 0.0f; ToEnemy = 0.0f } }

    let frame = Runner.stepWith env run { run.Motion with Pos = pos }
    pos <- { X = pos.X + frame.Delta.X; Y = pos.Y + frame.Delta.Y }
    run <- frame.Run
    // frame.Spawned: bullets fired this frame. frame.Vanished: this bullet is gone

C#

The F# API is reachable from C#. Functions compile to PascalCase (Runner.Load, NewRoot, StepWith), and the readers live in BulletmlModule.

using FsBulletML2;
using Microsoft.FSharp.Core;
using static FsBulletML2.Domain;

var xml = """
<bulletml xmlns="http://www.asahi-net.or.jp/~cs8k-cyu/bulletml">
  <action label="top">
    <fire><direction type="absolute">0</direction><speed>2</speed><bullet/></fire>
    <wait>1</wait>
    <vanish/>
  </action>
</bulletml>
""";

var rand = FuncConvert.FromFunc(() => 0.5f);
var rank = 0.5f;

// Load once per pattern
var script = Runner.Load(rand, rank, BulletmlModule.readXmlString(xml));
var run = Runner.NewRoot(DTD.BulletType.Enemy, script);
var pos = new Vec2(0f, 0f);

// Step once per frame
for (var i = 0; i < 3; i++)
{
    var env = new Env(rand, rank, new Aim(0f, 0f), new SpawnAim(0f, 0f));
    var m = run.Motion;
    var frame = Runner.StepWith(env, run, new Motion(pos, m.Speed, m.Dir, m.Accel));
    pos = new Vec2(pos.X + frame.Delta.X, pos.Y + frame.Delta.Y);
    run = frame.Run;
    // frame.Spawned: bullets fired this frame. frame.Vanished: this bullet is gone
}

MIT License.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.1 106 9/25/2026