Справочник API собран из Go doc-комментариев в исходном коде и написан на английском языке.
package projectiles
import "github.com/nsgo-dev/game/pkg/pixelfx/projectiles"Обзор
Package projectiles is pixelfx's projectiles category: arrows, tracers, cannon shots, energy discs, signal flares, homing missiles, laser bolts, magic missiles, muzzle flashes, plasma shots and rockets, each a pixelfx.Effect registered as "projectiles/<name>" when the package is imported.
Указатель
Переменные
var Arrow = &pixelfx.Effect{
Meta: pixelfx.Meta{
Name: "Arrow",
Desc: "An arrow in flight: a steel broadhead catching the light, a wooden shaft, fletching fluttering in the wind, streaks of air peeling off its head and swirling off its feathers.",
Tags: []string{"projectile", "arrow", "bow", "medieval", "directional", "loop"},
Size: [2]int{112, 32},
Origin: [2]int{92, 16},
Duration: arrowDuration,
Loop: true,
FPS: 30,
BG: "sky",
Options: []pixelfx.Option{
{Name: "palette", Default: pixelfx.Palette("#7a1f2c", "#b8323c", "#e8e2d6", "#ffffff")},
{Name: "wood", Default: pixelfx.Palette("#3a2414", "#6e4422", "#a8723c", "#d8a868")},
{Name: "steel", Default: pixelfx.Palette("#2e3648", "#5a6680", "#9aa6ba", "#dfe7f2")},
{Name: "wind", Default: pixelfx.Color("#b8c8e8")},
{Name: "seed", Default: pixelfx.Num(3)},
},
},
New: newArrow,
}Arrow is an arrow in flight: a steel broadhead catching the light, a wooden shaft, fletching fluttering in the wind, streaks of air peeling off its head and swirling off its feathers. It is registered as "projectiles/arrow".
var BulletTracer = &pixelfx.Effect{
Meta: pixelfx.Meta{
Name: "Bullet tracer",
Desc: "A white-hot slug tearing along, its tracer burning behind it in a long streak that sputters and cools from white through gold to red, shedding sparks and a thread of smoke.",
Tags: []string{"projectile", "bullet", "tracer", "gun", "directional", "loop"},
Size: [2]int{200, 40},
Origin: [2]int{184, 18},
Duration: bulletTracerDuration,
Loop: true,
FPS: 30,
BG: "sky",
Options: []pixelfx.Option{
{Name: "palette", Default: pixelfx.Palette("#4a1712", "#8a1f17", "#c9281f", "#f2561d", "#ff8a2a", "#ffc23d", "#ffe26b", "#fff3a6", "#ffffff")},
{Name: "smoke", Default: pixelfx.Palette("#2e2a36", "#46404f", "#625b6b", "#817a8a", "#a39caa")},
{Name: "length", Default: pixelfx.Num(120)},
{Name: "speed", Default: pixelfx.Num(520)},
{Name: "seed", Default: pixelfx.Num(4)},
},
},
New: newBulletTracer,
}BulletTracer is a white-hot slug tearing along, its tracer burning behind it in a long streak that sputters and cools from white through gold to red, shedding sparks and a thread of smoke. It is registered as "projectiles/bullet-tracer".
var Cannonball = &pixelfx.Effect{
Meta: pixelfx.Meta{
Name: "Cannon shot",
Desc: "A cannon fires from a muzzle `height` px above the floor (the origin): a white flash, a tongue of flame, the ball arcing off trailing smoke, a big gunsmoke cloud rolling out.",
Tags: []string{"projectile", "cannon", "cannonball", "smoke", "flash", "directional", "one-shot"},
Size: [2]int{208, 116},
Origin: [2]int{48, 102},
Duration: 3.8,
FPS: 30,
BG: "ground",
Options: []pixelfx.Option{
{Name: "palette", Default: pixelfx.Palette("#4a1712", "#8a1f17", "#c9281f", "#f2561d", "#ff8a2a", "#ffc23d", "#ffe26b", "#fff3a6", "#ffffff")},
{Name: "smoke", Default: pixelfx.Palette("#3a3542", "#55505e", "#736d7c", "#938d9b", "#b3adba", "#d2cdd6", "#ece8ee")},
{Name: "iron", Default: pixelfx.Palette("#141218", "#2c2a34", "#4c4a58", "#8a8898")},
{Name: "height", Default: pixelfx.Num(12)},
{Name: "seed", Default: pixelfx.Num(4)},
},
},
New: newCannonball,
}Cannonball is a cannon shot fired from a muzzle height px above the floor (the origin): a white flash, a tongue of flame, the ball arcing off trailing smoke, a big gunsmoke cloud rolling out. It is registered as "projectiles/cannonball".
var EnergyDisc = &pixelfx.Effect{
Meta: pixelfx.Meta{
Name: "Energy disc",
Desc: "A sawblade of crackling energy spinning flat out as it flies: hooked teeth bright on their leading edges, a white hub, spiral arms churning, sparks flung off the teeth.",
Tags: []string{"projectile", "disc", "saw", "energy", "sci-fi", "directional", "loop"},
Size: [2]int{120, 52},
Origin: [2]int{92, 26},
Duration: energyDiscDuration,
Loop: true,
FPS: 30,
BG: "sky",
Options: []pixelfx.Option{
{Name: "palette", Default: pixelfx.Palette("#0a0f2e", "#172a78", "#2550d0", "#3f8cff", "#7cc8ff", "#c8f0ff", "#ffffff")},
{Name: "size", Default: pixelfx.Num(9)},
{Name: "teeth", Default: pixelfx.Num(8)},
{Name: "speed", Default: pixelfx.Num(220)},
{Name: "seed", Default: pixelfx.Num(5)},
},
},
New: newEnergyDisc,
}EnergyDisc is a sawblade of crackling energy spinning flat out as it flies: hooked teeth bright on their leading edges, a white hub, spiral arms churning, sparks flung off the teeth. It is registered as "projectiles/energy-disc".
var Flare = &pixelfx.Effect{
Meta: pixelfx.Meta{
Name: "Signal flare",
Desc: "A signal flare streaks up off the ground trailing sparks and smoke, bursts, and hangs as a pulsing red star that drips sparks under its own red-lit smoke, then gutters out.",
Tags: []string{"projectile", "flare", "signal", "fire", "smoke", "light", "one-shot"},
Size: [2]int{152, 232},
Origin: [2]int{76, 226},
Duration: 5,
FPS: 30,
BG: "sky",
Options: []pixelfx.Option{
{Name: "palette", Default: pixelfx.Palette("#2a0610", "#5c0d1c", "#9a1428", "#d8243a", "#ff4d5e", "#ff8a94", "#ffd0d4", "#ffffff")},
{Name: "smoke", Default: pixelfx.Palette("#1e1a26", "#2e2938", "#433d4d", "#5b5466", "#77707f", "#958e9c", "#b3acb9")},
{Name: "height", Default: pixelfx.Num(150)},
{Name: "seed", Default: pixelfx.Num(2)},
},
},
New: newFlare,
}Flare is a signal flare that streaks up off the ground trailing sparks and smoke, bursts, and hangs as a pulsing red star that drips sparks under its own red-lit smoke, then gutters out. It is registered as "projectiles/flare".
var HomingMissile = &pixelfx.Effect{
Meta: pixelfx.Meta{
Name: "Homing missile",
Desc: "A missile kicks off, arcs up, rolls over and dives onto its target (the origin), its smoke trail left hanging in the air, and hits in a fiery blast of flame, sparks and rocks.",
Tags: []string{"projectile", "missile", "rocket", "homing", "smoke", "explosion", "one-shot"},
Size: [2]int{248, 140},
Origin: [2]int{160, 120},
Duration: homingMissileDuration,
FPS: 30,
BG: "ground",
Options: []pixelfx.Option{
{Name: "palette", Default: pixelfx.Palette("#4a1712", "#8a1f17", "#c9281f", "#f2561d", "#ff8a2a", "#ffc23d", "#ffe26b", "#fff3a6", "#ffffff")},
{Name: "metal", Default: pixelfx.Palette("#25243a", "#3e4058", "#61667f", "#8e97b0", "#c4cce0")},
{Name: "smoke", Default: pixelfx.Palette("#26222e", "#3b3644", "#544e5e", "#6f6979", "#8c8596", "#aca5b5", "#cbc4d2")},
{Name: "stone", Default: pixelfx.Color("#4a3f69")},
{Name: "seed", Default: pixelfx.Num(8)},
},
},
New: newHomingMissile,
}HomingMissile is a missile that kicks off, arcs up, rolls over and dives onto its target (the origin), its smoke trail left hanging in the air, and hits in a fiery blast of flame, sparks and rocks. It is registered as "projectiles/homing-missile".
var LaserBolt = &pixelfx.Effect{
Meta: pixelfx.Meta{
Name: "Laser bolt",
Desc: "A red laser bolt: a white-hot core in a rounded head, red bands tapering back, pulses racing down it, a tail that shimmers apart into wavering dashes.",
Tags: []string{"projectile", "laser", "energy", "sci-fi", "directional", "loop"},
Size: [2]int{128, 32},
Origin: [2]int{108, 16},
Duration: laserBoltDuration,
Loop: true,
FPS: 30,
BG: "sky",
Options: []pixelfx.Option{
{Name: "palette", Default: pixelfx.Palette("#2a0610", "#5c0d1c", "#9a1428", "#d8243a", "#ff4d5e", "#ff8a94", "#ffd0d4", "#ffffff")},
{Name: "length", Default: pixelfx.Num(40)},
{Name: "seed", Default: pixelfx.Num(2)},
},
},
New: newLaserBolt,
}LaserBolt is a red laser bolt: a white-hot core in a rounded head, red bands tapering back, pulses racing down it, a tail that shimmers apart into wavering dashes. It is registered as "projectiles/laser-bolt".
var MagicMissile = &pixelfx.Effect{
Meta: pixelfx.Meta{
Name: "Magic missile",
Desc: "Motes gather into an arcane orb at a hand `height` px above the floor (the origin); it weaves to its target trailing a twisting ribbon and bursts into a star of light.",
Tags: []string{"projectile", "magic", "arcane", "missile", "spell", "directional", "one-shot"},
Size: [2]int{208, 112},
Origin: [2]int{24, 104},
Duration: 1.9,
FPS: 30,
BG: "ground",
Options: []pixelfx.Option{
{Name: "palette", Default: pixelfx.Palette("#140a26", "#2b1252", "#481c88", "#6b2cc0", "#9a48ec", "#c684ff", "#ecc8ff", "#ffffff")},
{Name: "height", Default: pixelfx.Num(26)},
{Name: "reach", Default: pixelfx.Num(112)},
{Name: "seed", Default: pixelfx.Num(6)},
},
},
New: newMagicMissile,
}MagicMissile gathers motes into an arcane orb at a hand height px above the floor (the origin); it weaves to its target trailing a twisting ribbon and bursts into a star of light. It is registered as "projectiles/magic-missile".
var MuzzlePistol = &pixelfx.Effect{
Meta: pixelfx.Meta{
Name: "Pistol shot",
Desc: "One pistol shot from a muzzle `height` px above the floor (the origin): a spiky white-cored flash, sparks, a curl of smoke hooking up and back, a casing that bounces and settles.",
Tags: []string{"projectile", "muzzle", "gun", "pistol", "flash", "smoke", "casing", "directional", "one-shot"},
Size: [2]int{96, 72},
Origin: [2]int{44, 66},
Duration: muzzlePistolDuration,
FPS: 30,
BG: "ground",
Options: []pixelfx.Option{
{Name: "palette", Default: pixelfx.Palette("#4a1712", "#8a1f17", "#c9281f", "#f2561d", "#ff8a2a", "#ffc23d", "#ffe26b", "#fff3a6", "#ffffff")},
{Name: "brass", Default: pixelfx.Palette("#4a2e10", "#8c5c1c", "#d9a441", "#ffe39a")},
{Name: "smoke", Default: pixelfx.Palette("#26222e", "#3b3644", "#544e5e", "#6f6979", "#8c8596", "#aca5b5", "#cbc4d2")},
{Name: "height", Default: pixelfx.Num(26)},
{Name: "seed", Default: pixelfx.Num(3)},
},
},
New: newMuzzlePistol,
}MuzzlePistol is one pistol shot from a muzzle height px above the floor (the origin): a spiky white-cored flash, sparks, a curl of smoke hooking up and back, a casing that bounces and settles. It is registered as "projectiles/muzzle-pistol".
var MuzzleSMG = &pixelfx.Effect{
Meta: pixelfx.Meta{
Name: "SMG burst",
Desc: "Sustained fire at twelve rounds a second: each shot a different spiky flash with a white core, sparks, smoke wisps piling up and drifting, brass casings bouncing on the floor.",
Tags: []string{"projectile", "muzzle", "gun", "automatic", "flash", "smoke", "casing", "directional", "loop"},
Size: [2]int{112, 72},
Origin: [2]int{56, 66},
Duration: muzzleSMGDuration,
Loop: true,
FPS: 30,
BG: "ground",
Options: []pixelfx.Option{
{Name: "palette", Default: pixelfx.Palette("#4a1712", "#8a1f17", "#c9281f", "#f2561d", "#ff8a2a", "#ffc23d", "#ffe26b", "#fff3a6", "#ffffff")},
{Name: "brass", Default: pixelfx.Palette("#4a2e10", "#8c5c1c", "#d9a441", "#ffe39a")},
{Name: "smoke", Default: pixelfx.Palette("#26222e", "#3b3644", "#544e5e", "#6f6979", "#8c8596", "#aca5b5", "#cbc4d2")},
{Name: "height", Default: pixelfx.Num(26)},
{Name: "seed", Default: pixelfx.Num(6)},
},
},
New: newMuzzleSMG,
}MuzzleSMG is sustained fire at twelve rounds a second: each shot a different spiky flash with a white core, sparks, smoke wisps piling up and drifting, brass casings bouncing on the floor. It is registered as "projectiles/muzzle-smg".
var MuzzleShotgun = &pixelfx.Effect{
Meta: pixelfx.Meta{
Name: "Shotgun blast",
Desc: "A shotgun blast from a muzzle `height` px above the floor (the origin): a wide ragged fan of flame, pellet streaks, a heavy rolling smoke cloud, a red shell kicked out on the pump.",
Tags: []string{"projectile", "muzzle", "gun", "shotgun", "flash", "smoke", "casing", "directional", "one-shot"},
Size: [2]int{160, 88},
Origin: [2]int{44, 82},
Duration: muzzleShotgunDuration,
FPS: 30,
BG: "ground",
Options: []pixelfx.Option{
{Name: "palette", Default: pixelfx.Palette("#4a1712", "#8a1f17", "#c9281f", "#f2561d", "#ff8a2a", "#ffc23d", "#ffe26b", "#fff3a6", "#ffffff")},
{Name: "smoke", Default: pixelfx.Palette("#221e2a", "#36313f", "#4e4858", "#6a6474", "#888192", "#a8a1b1", "#c8c1cf")},
{Name: "shell", Default: pixelfx.Palette("#4a0f14", "#9a1e22", "#d8423a", "#8c5c1c", "#e9b54a")},
{Name: "height", Default: pixelfx.Num(26)},
{Name: "seed", Default: pixelfx.Num(5)},
},
},
New: newMuzzleShotgun,
}MuzzleShotgun is a shotgun blast from a muzzle height px above the floor (the origin): a wide ragged fan of flame, pellet streaks, a heavy rolling smoke cloud, a red shell kicked out on the pump. It is registered as "projectiles/muzzle-shotgun".
var PlasmaShot = &pixelfx.Effect{
Meta: pixelfx.Meta{
Name: "Plasma shot",
Desc: "A glowing plasma blob: hot knots churning in its core, a corona crackling over its skin, its tail necking into droplets that tear off, cool and wink out behind.",
Tags: []string{"projectile", "plasma", "energy", "sci-fi", "directional", "loop"},
Size: [2]int{144, 60},
Origin: [2]int{108, 30},
Duration: plasmaShotDuration,
Loop: true,
FPS: 30,
BG: "sky",
Options: []pixelfx.Option{
{Name: "palette", Default: pixelfx.Palette("#061a1c", "#0b3b34", "#0f6a4a", "#18a05a", "#3fd46a", "#8cf57e", "#d6ffc4", "#ffffff")},
{Name: "size", Default: pixelfx.Num(6)},
{Name: "speed", Default: pixelfx.Num(200)},
{Name: "seed", Default: pixelfx.Num(3)},
},
},
New: newPlasmaShot,
}PlasmaShot is a glowing plasma blob: hot knots churning in its core, a corona crackling over its skin, its tail necking into droplets that tear off, cool and wink out behind. It is registered as "projectiles/plasma-shot".
var Rocket = &pixelfx.Effect{
Meta: pixelfx.Meta{
Name: "Rocket",
Desc: "A steel rocket roars along: a flickering jet with shock diamonds and a white-hot nozzle, a thick billowing smoke trail lit by the flame, sparks shed behind.",
Tags: []string{"projectile", "rocket", "missile", "smoke", "fire", "directional", "loop"},
Size: [2]int{288, 76},
Origin: [2]int{252, 42},
Duration: rocketDuration,
Loop: true,
FPS: 30,
BG: "sky",
Options: []pixelfx.Option{
{Name: "palette", Default: pixelfx.Palette("#4a1712", "#8a1f17", "#c9281f", "#f2561d", "#ff8a2a", "#ffc23d", "#ffe26b", "#fff3a6", "#ffffff")},
{Name: "metal", Default: pixelfx.Palette("#0f0d16", "#25243a", "#3e4058", "#61667f", "#8e97b0", "#c4cce0", "#f2f6ff")},
{Name: "paint", Default: pixelfx.Palette("#3a0d14", "#7c1a22", "#bd2f2c", "#ec5a45", "#ff9b7e")},
{Name: "smoke", Default: pixelfx.Palette("#26222e", "#3d3846", "#5a5463", "#7e7887", "#a7a1ad", "#d0cad2", "#f1ecee")},
{Name: "speed", Default: pixelfx.Num(120)},
{Name: "seed", Default: pixelfx.Num(5)},
},
},
New: newRocket,
}Rocket is a steel rocket roaring along: a flickering jet with shock diamonds and a white-hot nozzle, a thick billowing smoke trail lit by the flame, sparks shed behind. It is registered as "projectiles/rocket".