Documentation ¶
Index ¶
Constants ¶
const ( BinMagic = "DOODLE" BinVersion uint8 = 1 // version of the file format we support BinLevelType uint8 = 1 BinDoodadType uint8 = 2 )
Binary file format headers for Levels and Doodads.
The header is 8 bytes long: "DOODLE" + file format version + file type number.
Variables ¶
var ( SystemDoodadsPath = filepath.Join("assets", "doodads") SystemLevelsPath = filepath.Join("assets", "levels") SystemCampaignsPath = filepath.Join("assets", "campaigns") SystemLevelPacksPath = filepath.Join("assets", "levelpacks") )
Paths to system-level assets bundled with the application.
Functions ¶
func FindFile ¶
FindFile looks for a file (level or doodad) in a few places.
The filename should already have a ".level" or ".doodad" file extension. If neither is given, the exact filename will be searched in all places.
1. Check in the files built into the program binary. 2. Check for system files in the binary's assets/ folder. 3. Check the user folders.
Returns the file path and an error if not found anywhere.
func FindFileEmbedded ¶
func FindFileEmbedded(filename string, em Embeddable) (string, error)
FindFileEmbedded searches for a file in a Level or Doodad's embedded filesystem, before searching other places (as FindFile does) -- system paths and user paths.
Types ¶
type Embeddable ¶
Embeddable file formats such as Levels or Doodads.