Skip to content

Particlebugfix#1473

Open
jasmine3339 wants to merge 11 commits intoAlmasB:devfrom
jasmine3339:particlebugfix
Open

Particlebugfix#1473
jasmine3339 wants to merge 11 commits intoAlmasB:devfrom
jasmine3339:particlebugfix

Conversation

@jasmine3339
Copy link
Copy Markdown

Fixing issues #1412 - Particle Bug

the initial error line:
var sx = (scaleOrigin.x + x - entityScale.x * (scaleOrigin.x + x)) + entityScale.y * x;

has been changed to:
var sx = (scaleOrigin.x + x - entityScale.x * (scaleOrigin.x + x)) + entityScale.x * x;

Sample code is also included to show this works.

this shows the difference in having the x and y set to be different things, both should be circles, but before the particle scale bug fix, one is an oval as they are not expanding in the correct scale. works without any other changes to fxgl
showing the corrected variable in both, allowing particle scale in intermediate samples to work and demonstrate the need of the change, and the effects of the bug fix
Added comments to clarify the behavior of particle scaling and its effect on positioning.
Removed the 'corrected' boolean field and its setter method. Simplified the scaling calculations by removing unnecessary comments and logic related to 'corrected'.
…eSample.java

deleted first sample, as corrected functionality gone from both particle and particle emitter.
Removed the corrected field and its setter method from ParticleEmitter.
Removed the conditional setting of corrected flag for emitted particles.
Copy link
Copy Markdown
Owner

@AlmasB AlmasB left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this. Your IDE may have added extra changes, which should not be part of this PR. Please can you check below.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants