gen

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 28, 2026 License: Apache-2.0 Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package gen draws every file of the placeholder asset pack in code: sprite strips, a tileset with a Tiled tileset and map, a bitmap font, sounds and models, with the import settings sidecar of each image and sound.

Files returns the same bytes on every run and every architecture: the drawing and synthesis use integer arithmetic, comparisons, square roots and products converted to float64 before they are summed, which the compiler may not fuse into a multiply-add, and no function such as math.Sin or math.Exp whose last bit differs between architectures. Package placeholder's tests compare the committed pack with Files, and rewrite it with -update.

Index

Constants

View Source
const (
	MusicBPM   = 150
	MusicBeats = 16
)

Music's tempo: MusicBeats beats at MusicBPM, so the loop is a whole number of samples and every note starts on a sample.

View Source
const (
	TileColumns = 8
	TileRows    = 4
)

TileColumns and TileRows are the tileset's size in tiles.

View Source
const (
	LevelWidth  = 40
	LevelHeight = 15
)

Level is the sample level's size in tiles.

View Source
const Cell = 16

Cell is the size in pixels of a sprite frame and of a tile.

View Source
const SampleRate = 22050

SampleRate is the sample rate of every sound in the pack, in Hz. The sounds are mono, 16-bit PCM WAV.

Variables

View Source
var Tiles = [TileColumns * TileRows]tileInfo{
	{/* contains filtered or unexported fields */},
	{/* contains filtered or unexported fields */},
	{/* contains filtered or unexported fields */},
	{/* contains filtered or unexported fields */},
	{/* contains filtered or unexported fields */},
	{/* contains filtered or unexported fields */},
	{/* contains filtered or unexported fields */},
	{/* contains filtered or unexported fields */},
	{/* contains filtered or unexported fields */},
	{/* contains filtered or unexported fields */},
	{/* contains filtered or unexported fields */},
	{/* contains filtered or unexported fields */},
	{/* contains filtered or unexported fields */},
	{/* contains filtered or unexported fields */},
	{/* contains filtered or unexported fields */},
	{/* contains filtered or unexported fields */},
	{/* contains filtered or unexported fields */},
	{/* contains filtered or unexported fields */},
	{/* contains filtered or unexported fields */},
	{/* contains filtered or unexported fields */},
	{/* contains filtered or unexported fields */},
	{/* contains filtered or unexported fields */},
	{/* contains filtered or unexported fields */},
	{/* contains filtered or unexported fields */},
	{/* contains filtered or unexported fields */},
	{/* contains filtered or unexported fields */},
	{/* contains filtered or unexported fields */},
	{/* contains filtered or unexported fields */},
	{/* contains filtered or unexported fields */},
	{/* contains filtered or unexported fields */},
	{/* contains filtered or unexported fields */},
	{/* contains filtered or unexported fields */},
}

Tiles are the tileset's tiles by id.

Functions

func Files

func Files() (map[string][]byte, error)

Files returns every file of the pack by its slash-separated path in the pack, except CREDITS.md, which a person writes.

func Paths

func Paths(files map[string][]byte) []string

Paths returns the paths of files in order.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL