Header menu logo Mibo

Platformer Module

A domain module providing standard layout stamps for Platformer games. These functions generate geometry using standard Layout primitives. They are agnostic to the layer or content type, allowing flexible reuse.

Types

Type Description

Anchor

Anchor side for ledges or alignment.

StairDirection

Direction for stairs and slopes construction.

Functions and values

Function or value Description

box width height border fill section

Full Usage: box width height border fill section

Parameters:
    width : int - Total width including border.
    height : int - Total height including border.
    border : 'T - Content for the border.
    fill : 'T - Content for the interior.
    section : GridSection2D<'T>

Returns: GridSection2D<'T>
Modifiers: inline
Type parameters: 'T

Generates a rectangular box with a border and filled interior.

width : int

Total width including border.

height : int

Total height including border.

border : 'T

Content for the border.

fill : 'T

Content for the interior.

section : GridSection2D<'T>
Returns: GridSection2D<'T>

gap width height section

Full Usage: gap width height section

Parameters:
    width : int - Width of the gap.
    height : int - Height of the gap.
    section : GridSection2D<'T>

Returns: GridSection2D<'T>
Modifiers: inline
Type parameters: 'T

Creates a rectangular empty area by clearing cells. Use this to carve out spaces in existing terrain.

width : int

Width of the gap.

height : int

Height of the gap.

section : GridSection2D<'T>
Returns: GridSection2D<'T>

ledge width anchor tile section

Full Usage: ledge width anchor tile section

Parameters:
Returns: GridSection2D<'T>
Modifiers: inline
Type parameters: 'T

Generates a horizontal platform anchored to a specific side of the section.

width : int
anchor : Anchor
tile : 'T
section : GridSection2D<'T>
Returns: GridSection2D<'T>

pillar height baseTile middleTile topTile section

Full Usage: pillar height baseTile middleTile topTile section

Parameters:
    height : int
    baseTile : 'T
    middleTile : 'T
    topTile : 'T
    section : GridSection2D<'T>

Returns: GridSection2D<'T>
Modifiers: inline
Type parameters: 'T

Generates a 1-tile wide vertical structure with distinct base, middle, and top tiles.

height : int
baseTile : 'T
middleTile : 'T
topTile : 'T
section : GridSection2D<'T>
Returns: GridSection2D<'T>

pit width depth section

Full Usage: pit width depth section

Parameters:
    width : int - Width of the pit.
    depth : int - Depth of the pit (how many cells to clear vertically).
    section : GridSection2D<'T>

Returns: GridSection2D<'T>
Modifiers: inline
Type parameters: 'T

Creates a horizontal pit (gap in the ground) by clearing a column of cells. Use this to create fall-through areas or deadly gaps.

width : int

Width of the pit.

depth : int

Depth of the pit (how many cells to clear vertically).

section : GridSection2D<'T>
Returns: GridSection2D<'T>

platform width tile section

Full Usage: platform width tile section

Parameters:
    width : int - Width of the platform.
    tile : 'T - Content for the platform.
    section : GridSection2D<'T>

Returns: GridSection2D<'T>
Modifiers: inline
Type parameters: 'T

Generates a horizontal platform.

width : int

Width of the platform.

tile : 'T

Content for the platform.

section : GridSection2D<'T>
Returns: GridSection2D<'T>

scatterEdges count seed content section

Full Usage: scatterEdges count seed content section

Parameters:
    count : int
    seed : int
    content : 'T
    section : GridSection2D<'T>

Returns: GridSection2D<'T>
Modifiers: inline
Type parameters: 'T

Scatters content along the outer edges of the current section. Useful for adding "vines" or "spikes" to platforms.

count : int
seed : int
content : 'T
section : GridSection2D<'T>
Returns: GridSection2D<'T>

slope width height tile direction section

Full Usage: slope width height tile direction section

Parameters:
Returns: GridSection2D<'T>
Modifiers: inline
Type parameters: 'T

Generates a smooth diagonal slope using line rasterization.

width : int
height : int
tile : 'T
direction : StairDirection
section : GridSection2D<'T>
Returns: GridSection2D<'T>

stairs width tile direction section

Full Usage: stairs width tile direction section

Parameters:
    width : int - Total width of the stairs area.
    tile : 'T - Content for the steps.
    direction : StairDirection - Direction of the stairs.
    section : GridSection2D<'T>

Returns: GridSection2D<'T>
Modifiers: inline
Type parameters: 'T

Generates a staircase.

width : int

Total width of the stairs area.

tile : 'T

Content for the steps.

direction : StairDirection

Direction of the stairs.

section : GridSection2D<'T>
Returns: GridSection2D<'T>

wall height tile section

Full Usage: wall height tile section

Parameters:
    height : int - Height of the wall.
    tile : 'T - Content for the wall.
    section : GridSection2D<'T>

Returns: GridSection2D<'T>
Modifiers: inline
Type parameters: 'T

Generates a vertical wall or pillar.

height : int

Height of the wall.

tile : 'T

Content for the wall.

section : GridSection2D<'T>
Returns: GridSection2D<'T>

weather oldContent newContent probability seed section

Full Usage: weather oldContent newContent probability seed section

Parameters:
    oldContent : 'T
    newContent : 'T
    probability : float32
    seed : int
    section : GridSection2D<'T>

Returns: GridSection2D<'T>
Modifiers: inline
Type parameters: 'T

Non-destructively decorates existing surfaces by replacing a percentage of tiles. Perfect for adding moss to stone or cracks to walls.

oldContent : 'T
newContent : 'T
probability : float32
seed : int
section : GridSection2D<'T>
Returns: GridSection2D<'T>

Type something to start searching.