Repository navigation
Conversation
The particles skill said the spawn area is measured from the position given to the constructor, and told games to offset by half. The constructor centres the area on (x, y), so that advice moved every effect up and left by half its size. Only `pos` set afterwards is the area's top left corner. - skill: pass the centre to the constructor; offset by half only when moving `pos` later; symptom rows for both mistakes - TSDoc for the constructor and the `width` setting - tests pinning both behaviours down Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JnzwA2BZwXkRJLpNxCXBNt
obiot
pushed a commit
that referenced
this pull request
Nov 2, 2026
ESLint's arrow-body-style rule failed CI's lint step on the two one-line `.map((p) => p.pos.x)` callbacks, so the tests never ran (#1832). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JnzwA4xBNBw7cEZzG1bUru
5 of 10 tasks
Member
Author
|
Replaced by #1835: this PR's commit, unchanged, plus a fix for the two ESLint Generated by Claude Code |
obiot
added a commit
that referenced
this pull request
Nov 2, 2026
The particles skill said a ParticleEmitter's spawn area is measured from the position given to the constructor, and told games to offset by half. The constructor centres the area on (x, y), so that advice put every effect up and to the left by half its size; only pos set after construction is the area's top-left corner. - skill: pass the centre to the constructor; offset by half only when moving pos later; symptom rows for both mistakes - TSDoc: the constructor's x / y and the width setting say where the area goes - tests: the constructor centres the area, and moving pos places its top-left corner Replaces #1832, with its lint errors fixed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The particles skill said a
ParticleEmitter's spawn area is measured from the position given to the constructor, and told games to offset by half:The constructor actually centres the area on (x, y) (
centerOn(x, y)), so following that advice puts every effect up and to the left by half its size. Onlyposset after construction is the area's top-left corner.melonjs-particles-and-trails): pass the centre to the constructor; offset by half only when movingposlater (re-aiming one emitter per burst). Symptom rows for both mistakes.x/yand thewidthsetting now say where the area goes.tests/particle-spawn-area.spec.js): the constructor centres the area, and movingposplaces its top-left corner.No engine behaviour changes, so no changelog entry.
Found while building the Starsweep example: its 3D star dust ended up off to one side.
Type of change
Checklist
pnpm lintpasses): Biome checked on the changed filespnpm testpasses): the new spec passes; the rest is untouchedpnpm build): left to CI, as only comments changed insrc/Related issues
None.
Generated by Claude Code