Die API-Referenz stammt aus den Go-Doc-Kommentaren im Quellcode und ist auf Englisch verfasst.
package explosions
import "github.com/nsgo-dev/game/pkg/pixelfx/explosions"Übersicht
Package explosions is pixelfx's explosions category: barrel explosion, big explosion, cartoon POW, dirt explosion, firework burst, firework rocket, grenade, implosion, nuke, plasma explosion, small explosion and smoke bomb, each a pixelfx.Effect registered as "explosions/<name>" when the package is imported.
Index
Variablen
var BarrelExplosion = &pixelfx.Effect{
Meta: pixelfx.Meta{
Name: "Barrel explosion",
Desc: "An explosive barrel shudders, its lid bulging and spitting flame, then blows: a fireball column, staves and the lid flying, burning fuel splashed over the floor.",
Tags: []string{"explosion", "barrel", "fire", "smoke", "debris", "ground", "one-shot"},
Size: [2]int{barrelW, barrelH},
Origin: [2]int{barrelOX, barrelOY},
Duration: barrelDuration,
FPS: 30,
BG: "ground",
Options: []pixelfx.Option{
{Name: "palette", Default: pixelfx.Palette("#4a1712", "#c9281f", "#f2561d", "#ff8a2a", "#ffc23d", "#ffe26b", "#fff3a6", "#ffffff")},
{Name: "barrel", Default: pixelfx.Palette("#1c0a0e", "#4a1218", "#7c1a1e", "#b02a26", "#d8483a", "#f08a70")},
{Name: "seed", Default: pixelfx.Num(8)},
},
},
New: newBarrelExplosion,
}BarrelExplosion is an explosive barrel that shudders, its lid bulging and spitting flame, then blows: a fireball column, staves and the lid flying, burning fuel splashed over the floor. It is registered as "explosions/barrel-explosion".
var BigExplosion = &pixelfx.Effect{
Meta: pixelfx.Meta{
Name: "Big explosion",
Desc: "A huge ground blast in three beats: a white dome, a rolling fireball that climbs into a mushrooming smoke column, heavy rocks, and fires left burning.",
Tags: []string{"explosion", "fire", "smoke", "debris", "mushroom", "big", "ground", "one-shot"},
Size: [2]int{bigW, bigH},
Origin: [2]int{bigOX, bigOY},
Duration: bigDuration,
FPS: 30,
BG: "ground",
Options: []pixelfx.Option{
{Name: "palette", Default: pixelfx.Palette("#4a1712", "#c9281f", "#f2561d", "#ff8a2a", "#ffc23d", "#ffe26b", "#fff3a6", "#ffffff")},
{Name: "stone", Default: pixelfx.Color("#4a3f69")},
{Name: "seed", Default: pixelfx.Num(11)},
},
},
New: newBigExplosion,
}BigExplosion is a huge ground blast in three beats: a white dome, a rolling fireball that climbs into a mushrooming smoke column, heavy rocks, and fires left burning. It is registered as "explosions/big-explosion".
var CartoonPow = &pixelfx.Effect{
Meta: pixelfx.Meta{
Name: "Cartoon POW",
Desc: "A comic-book hit: a jagged two-tone burst star slams in with a shake and boiling edges, POW! drops in letter by letter, action lines fly, then it all snaps away.",
Tags: []string{"cartoon", "comic", "pow", "hit", "impact", "text", "one-shot"},
Size: [2]int{powW, powH},
Origin: [2]int{powOX, powOY},
Duration: 1.05,
FPS: 30,
BG: "dark",
Options: []pixelfx.Option{
{Name: "palette", Default: pixelfx.Palette("#1a0e14", "#6e1a12", "#c8361a", "#f47a24", "#ffc23c", "#fff07a", "#ffffff")},
{Name: "text", Default: pixelfx.Text("POW!")},
{Name: "seed", Default: pixelfx.Num(5)},
},
},
New: newCartoonPow,
}CartoonPow is a comic-book hit: a jagged two-tone burst star slams in with a shake and boiling edges, the word (POW! by default) drops in letter by letter, action lines fly, then it all snaps away. It is registered as "explosions/cartoon-pow".
var DirtExplosion = &pixelfx.Effect{
Meta: pixelfx.Meta{
Name: "Dirt explosion",
Desc: "A buried charge goes off: a flash under the floor, a V of dirt clods and grit thrown high, a brown dust plume that billows and settles, and a crater left behind.",
Tags: []string{"explosion", "dirt", "earth", "dust", "debris", "ground", "one-shot"},
Size: [2]int{dirtW, dirtH},
Origin: [2]int{dirtOX, dirtOY},
Duration: dirtDuration,
FPS: 30,
BG: "ground",
Options: []pixelfx.Option{
{Name: "palette", Default: pixelfx.Palette("#1c1610", "#33281c", "#4f3f2c", "#6e5a40", "#927a58", "#b89f78", "#dcc8a2")},
{Name: "fire", Default: pixelfx.Palette("#4a1712", "#c9281f", "#f2561d", "#ff8a2a", "#ffc23d", "#ffe26b", "#fff3a6", "#ffffff")},
{Name: "seed", Default: pixelfx.Num(3)},
},
},
New: newDirtExplosion,
}DirtExplosion is a buried charge going off: a flash under the floor, a V of dirt clods and grit thrown high, a brown dust plume that billows and settles, and a crater left behind. It is registered as "explosions/dirt-explosion".
var FireworkBurst = &pixelfx.Effect{
Meta: pixelfx.Meta{
Name: "Firework burst",
Desc: "A shell climbs, slows and bursts into a sphere of coloured trailing stars round a gold core; they droop, crackle into white pops and fade, leaving glitter.",
Tags: []string{"firework", "celebration", "sparkle", "sky", "burst", "one-shot"},
Size: [2]int{240, 248},
Origin: [2]int{120, 100},
Duration: 3.6,
FPS: 30,
BG: "sky",
Options: []pixelfx.Option{
{Name: "palette", Default: pixelfx.Palette("#3d0a33", "#701560", "#b0228f", "#f53cd1", "#ff86e6", "#ffd2f6", "#ffffff")},
{Name: "core", Default: pixelfx.Palette("#4a2c08", "#86520c", "#c48412", "#f0b424", "#ffe066", "#fff6c4", "#ffffff")},
{Name: "seed", Default: pixelfx.Num(9)},
},
},
New: newFireworkBurst,
}FireworkBurst is a shell that climbs, slows and bursts into a sphere of coloured trailing stars round a gold core; they droop, crackle into white pops and fade, leaving glitter. It is registered as "explosions/firework-burst".
var FireworkRocket = &pixelfx.Effect{
Meta: pixelfx.Meta{
Name: "Firework rocket",
Desc: "A rocket fizzes off the ground on a sparkling gold trail, coasts, and bursts into a palm: heavy gold fronds arc out, droop on glittering trails and crackle at the tips.",
Tags: []string{"firework", "rocket", "celebration", "sparkle", "sky", "one-shot"},
Size: [2]int{rocketW, rocketH},
Origin: [2]int{rocketOX, rocketOY},
Duration: 3.8,
FPS: 30,
BG: "sky",
Options: []pixelfx.Option{
{Name: "palette", Default: pixelfx.Palette("#2a1406", "#6a3a0c", "#b8701a", "#f0a830", "#ffd860", "#fff2b0", "#ffffff")},
{Name: "tips", Default: pixelfx.Palette("#0c2a3a", "#1a5a78", "#36a2c8", "#7cd8f0", "#c8f4ff", "#ffffff")},
{Name: "seed", Default: pixelfx.Num(12)},
},
},
New: newFireworkRocket,
}FireworkRocket is a rocket that fizzes off the ground on a sparkling gold trail, coasts, and bursts into a palm: heavy gold fronds arc out, droop on glittering trails and crackle at the tips. It is registered as "explosions/firework-rocket".
var Grenade = &pixelfx.Effect{
Meta: pixelfx.Meta{
Name: "Grenade",
Desc: "A grenade is lobbed in, bounces, rolls to a stop with its fuse fizzing, shudders, then blows: a white flash, shrapnel streaks, sparks, a small fireball and a scorch.",
Tags: []string{"explosion", "grenade", "shrapnel", "fire", "smoke", "ground", "one-shot"},
Size: [2]int{grenadeW, grenadeH},
Origin: [2]int{grenadeOX, grenadeOY},
Duration: grenadeDuration,
FPS: 30,
BG: "ground",
Options: []pixelfx.Option{
{Name: "palette", Default: pixelfx.Palette("#4a1712", "#c9281f", "#f2561d", "#ff8a2a", "#ffc23d", "#ffe26b", "#fff3a6", "#ffffff")},
{Name: "body", Default: pixelfx.Palette("#141a10", "#2c3a1e", "#4a5c30", "#6e8446", "#9ab06a")},
{Name: "seed", Default: pixelfx.Num(6)},
},
},
New: newGrenade,
}Grenade is a grenade lobbed in that bounces, rolls to a stop with its fuse fizzing, shudders, then blows: a white flash, shrapnel streaks, sparks, a small fireball and a scorch. It is registered as "explosions/grenade".
var Implosion = &pixelfx.Effect{
Meta: pixelfx.Meta{
Name: "Implosion",
Desc: "Everything is sucked in: streaks and grit rush inward, rings contract and a dark sphere collapses onto a crushed white point; a beat of stillness, then a sharp pop.",
Tags: []string{"implosion", "energy", "magic", "collapse", "pop", "one-shot"},
Size: [2]int{implW, implH},
Origin: [2]int{implOX, implOY},
Duration: 1.65,
FPS: 30,
BG: "dark",
Options: []pixelfx.Option{
{Name: "palette", Default: pixelfx.Palette("#0a0614", "#1c1236", "#3a2470", "#6a44c0", "#a080f0", "#d8c8ff", "#ffffff")},
{Name: "seed", Default: pixelfx.Num(2)},
},
},
New: newImplosion,
}Implosion sucks everything in: streaks and grit rush inward, rings contract and a dark sphere collapses onto a crushed white point; a beat of stillness, then a sharp pop. It is registered as "explosions/implosion".
var Nuke = &pixelfx.Effect{
Meta: pixelfx.Meta{
Name: "Nuke",
Desc: "A blinding white frame, then a fireball lifts on a thin stem into a wide rolling cap that glows from inside; a white skirt flashes and a dust surge sweeps the floor.",
Tags: []string{"explosion", "nuke", "mushroom", "cloud", "big", "ground", "one-shot"},
Size: [2]int{nukeW, nukeH},
Origin: [2]int{nukeOX, nukeOY},
Duration: 9,
FPS: 30,
BG: "ground",
Options: []pixelfx.Option{
{Name: "palette", Default: pixelfx.Palette("#4a1712", "#c9281f", "#f2561d", "#ff8a2a", "#ffc23d", "#ffe26b", "#fff3a6", "#ffffff")},
{Name: "dust", Default: pixelfx.Color("#8a7466")},
{Name: "seed", Default: pixelfx.Num(5)},
},
},
New: newNuke,
}Nuke is a blinding white frame, then a fireball that lifts on a thin stem into a wide rolling cap glowing from inside; a white skirt flashes and a dust surge sweeps the floor. It is registered as "explosions/nuke".
var PlasmaExplosion = &pixelfx.Effect{
Meta: pixelfx.Meta{
Name: "Plasma explosion",
Desc: "A blue-violet energy blast with no smoke: a white flash, a ball of plasma swelling into a thinning shell, shock rings in and out of depth, lightning arcs crackling off it.",
Tags: []string{"explosion", "plasma", "energy", "electric", "magic", "sci-fi", "one-shot"},
Size: [2]int{plasmaW, plasmaH},
Origin: [2]int{plasmaOX, plasmaOY},
Duration: 1.7,
FPS: 30,
BG: "dark",
Options: []pixelfx.Option{
{Name: "palette", Default: pixelfx.Palette("#0a0828", "#1a1c6e", "#2c3cc0", "#4a7cf0", "#7cc0ff", "#c8ecff", "#ffffff")},
{Name: "accent", Default: pixelfx.Palette("#1c0a30", "#4a1a8c", "#8a3ce0", "#c48cff", "#f0d8ff")},
{Name: "seed", Default: pixelfx.Num(7)},
},
},
New: newPlasmaExplosion,
}PlasmaExplosion is a blue-violet energy blast with no smoke: a white flash, a ball of plasma swelling into a thinning shell, shock rings in and out of depth, lightning arcs crackling off it. It is registered as "explosions/plasma-explosion".
var SmallExplosion = &pixelfx.Effect{
Meta: pixelfx.Meta{
Name: "Explosion",
Desc: "A ground blast: a white flash and shock rings, fire that cools into a rolling smoke column, sparks, burning brands that land and keep burning, tumbling rocks and a glowing scorch.",
Tags: []string{"explosion", "fire", "smoke", "debris", "impact", "one-shot"},
Size: [2]int{300, 240},
Origin: [2]int{150, 196},
Duration: smallDuration,
FPS: 30,
BG: "ground",
Options: []pixelfx.Option{
{Name: "palette", Default: pixelfx.Palette("#4a1712", "#c9281f", "#f2561d", "#ff8a2a", "#ffc23d", "#ffe26b", "#fff3a6", "#ffffff")},
{Name: "stone", Default: pixelfx.Color("#4a3f69")},
{Name: "size", Default: pixelfx.Num(1)},
{Name: "seed", Default: pixelfx.Num(7)},
},
},
New: newSmallExplosion,
}SmallExplosion is a ground blast: a white flash and shock rings, fire that cools into a rolling smoke column, sparks, burning brands that land and keep burning, tumbling rocks and a glowing scorch. It is registered as "explosions/small-explosion".
var SmokeBomb = &pixelfx.Effect{
Meta: pixelfx.Meta{
Name: "Smoke bomb",
Desc: "A round canister clinks down, fuse sparking, and pops: thick grey-violet smoke gushes out, rolls along the floor, billows into a cloud that hides all, then thins to wisps.",
Tags: []string{"smoke", "smoke-bomb", "ninja", "vanish", "escape", "ground", "one-shot"},
Size: [2]int{smokeW, smokeH},
Origin: [2]int{smokeOX, smokeOY},
Duration: smokeDuration,
FPS: 30,
BG: "ground",
Options: []pixelfx.Option{
{Name: "palette", Default: pixelfx.Palette("#0e0b14", "#1e1828", "#30283e", "#463c58", "#62567a", "#867a9e", "#aea4c4")},
{Name: "canister", Default: pixelfx.Palette("#16121e", "#2a2434", "#443c52", "#686078", "#9c94ac")},
{Name: "sparks", Default: pixelfx.Palette("#fff3a6", "#ffe26b", "#ff8a2a", "#f2561d")},
{Name: "seed", Default: pixelfx.Num(3)},
},
},
New: newSmokeBomb,
}SmokeBomb is a round canister that clinks down, fuse sparking, and pops: thick grey-violet smoke gushes out, rolls along the floor, billows into a cloud that hides all, then thins to wisps. It is registered as "explosions/smoke-bomb".