Skip to content

Plugin Feedback Effects

Arnel Robles edited this page Oct 2, 2026 · 2 revisions

Plugin: Feedback Effects

dopaminejs-plugin-feedback-effects 1.0.2. Needs dopaminejs 2.0.1 or newer.

npm install dopaminejs-plugin-feedback-effects

Floating text and confetti drawn on the game canvas, as game objects in the current scene. It needs a Game with a scene. For feedback on a normal web page, use Game UI instead.

import { Game, Scene } from 'dopaminejs';
import { FeedbackPlugin } from 'dopaminejs-plugin-feedback-effects';

const game = new Game();
game.kernel.plugins.use(FeedbackPlugin);
game.setScene(new Scene());
game.start();

const feedback = game.kernel.systems.get('feedback');
feedback.trigger('milestone', 400, 300);

trigger(type, x, y, options)

x and y are canvas coordinates.

Type Text Colour Confetti
oops Oops! #FF4444 none
milestone MILESTONE! #FFD700 50
faster FASTER! #50fa7b none
levelup LEVEL UP! #bd93f9 30

Any other type shows options.text, and nothing when no text is given.

feedback.trigger('custom', 400, 300, { text: '+3 streak', color: '#06d6a0', fontSize: 32 });
Option Default Meaning
text the preset Text to show
color the preset, or #FFFFFF Text colour
count the preset Confetti pieces, for types that have confetti
fontSize 24 Pixels
fontFamily 'Outfit' Load the font yourself, or pass one you have
velocityY -100 Pixels per second. Negative moves up.
lifetime 1.0 Seconds

emitConfetti(x, y, count = 50)

Confetti without text. The count is capped at 500, because each piece is a game object.

Without a scene

trigger does nothing when no scene is running. emitConfetti logs a warning.

Removing it

game.kernel.plugins.remove('feedback-effects');

With dopaminejs 2.4.0 or newer this also unregisters the feedback system. The plugin has no destroy, so on an older core call game.kernel.systems.unregister('feedback') too.

Other exports

FeedbackSystem, FloatingText and ConfettiParticle, for building your own effects. FloatingText and ConfettiParticle are components.

Clone this wiki locally