JumPHP extension: particles (read-only split of jumphp/jumPhp extensions/particles)
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-11-05 10:05:22 +01:00
doc JumPHP 0.5.13, IDE 0.1.52: the extensions' samples in doc/samples (three new ones, a physics demo game, a SamplesTest in every demo), a ▶ on a scene's class line runs that scene only 2026-11-05 10:05:22 +01:00
src Engine extensions: Composer packages of type jumphp-extension found at boot (services, boot class, asset loaders, config keys), extension:new and its skeleton, a first one: particles (emitters, bursts, seeded) with its demo game 2026-11-04 05:21:11 +01:00
composer.json Extensions: extra.jumphp.engine (the JumPHP versions an extension works with, checked at boot, Constraint), declared by the three extensions and the template; the template's README with the steps to publish 2026-11-04 22:12:26 +01:00
LICENSE Extensions on Packagist: each split to its own repository on every tag (extensions-split workflow, tools/extensions-publish.sh, dry run by default), composer.json valid without jumphp/engine, docs 2026-11-04 10:41:59 +01:00
README.md Engine extensions: Composer packages of type jumphp-extension found at boot (services, boot class, asset loaders, config keys), extension:new and its skeleton, a first one: particles (emitters, bursts, seeded) with its demo game 2026-11-04 05:21:11 +01:00

jumphp/particles

A particle engine for JumPHP games, and the first JumPHP engine extension (docs/extensions.md): a Composer package of type jumphp-extension the engine finds by itself.

public function __construct(private ParticleSystem $particles) {}          // a scene: its own system

public function enter(array $params = []): void
{
    $this->particles->reset();
    $this->fire = $this->particles->add(new Emitter(['x' => 160, 'y' => 150, 'rate' => 80, 'life' => [0.6, 1.2],
        'speed' => [30, 70], 'angle' => -90, 'spread' => 20, 'gravity' => -40,
        'colors' => ['#fff6a0', '#ff9a1f', '#c0301000'], 'size' => [5, 1], 'shape' => 'circle']));
}

public function update(float $dt): void { $this->particles->update($dt); }
public function render(Renderer $r): void { $this->particles->render($r); }

burst($emitter, 40) for explosions, moveTo() to follow an entity, .particles.json files read with $this->engine->extensions()->load('assets/fx/torch.particles.json'), particles: {max: 4000, seed: 1} in config/project.yaml. Example: games/particles-demo.