Logo Mibo

AdaptiveRaylibProgram Module

Raylib-specific AdaptiveProgram builder extensions.

Types

Type Description

BankEntry

One entry of a sound bank: a game-vocabulary key bound to the file that plays under it. The whole bank loads before the program's Init runs.

Functions and values

Function or value Description

withBank bank program

Full Usage: withBank bank program

Parameters:
Returns: AdaptiveProgram<'Frame>
Type parameters: 'Frame

Configures the game's sound bank: every entry loads before the program's Init runs, so ctx.Audio.play/ctx.Audio.playMusic can start sounds from the first step.

The bank is an ordinary F# value: a list literal for small games, or a generated value for large ones (a naming convention, a manifest, a directory scan). List order is load order; a key registered twice keeps the first entry. The adaptive counterpart of RaylibProgram.withBank: same entries, same load slot (service registrations run before Init).

bank : BankEntry list
program : AdaptiveProgram<'Frame>
Returns: AdaptiveProgram<'Frame>
Example

 let program =
   AdaptiveProgram.mkProgram init update
   |> AdaptiveRaylibProgram.withBank
     [ Sound("jump", "assets/jump.wav")
       Music("overworld", "assets/overworld.ogg") ]

 AdaptiveRaylibGame(program).Run()
val program: obj

Type something to start searching.