Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add RandomEffectController #1203

Merged
merged 11 commits into from
Dec 12, 2021

Conversation

st-pasha
Copy link
Contributor

Description

Add RandomEffectController -- a controller that makes the duration of some other effect controller random. This could be useful if the user wants to inject some amount of unpredictability into the effect.

Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • My PR includes unit or integration tests for all changed/updated/fixed behaviors and are passing (See Contributor Guide).
  • My PR does not decrease the code coverage, or I have a very special case and explained on the PR description why this PR decreases the coverage.
  • I updated/added relevant documentation (doc comments with ///) and updated/added examples in doc/examples.
  • I have formatted my code with flutter format and the flutter analyze does not report any problems.
  • I read and followed the Flame Style Guide.
  • I have added a description of the change under [next] in CHANGELOG.md.
  • I removed the Draft status, by clicking on the Ready for review button in this PR.
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

  • No, this is not a breaking change.

doc/effects.md Show resolved Hide resolved
doc/effects.md Show resolved Hide resolved
/// [RandomVariable] is an object capable of producing random values with the
/// prescribed distribution function. Each distribution is implemented within
/// its own derived class.
abstract class RandomVariable {
Copy link
Member

Choose a reason for hiding this comment

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

I have a feeling this could be useful in a general context, not only to random effect controller;
For example, on Gravity I introduced a method similar to Uniform Random Variable
If so, we could move it to its own file and add factory methods to create both private implementations.
Thoughts?

Copy link
Member

Choose a reason for hiding this comment

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

Probably as a follow-up though?

Copy link
Member

@luanpotter luanpotter left a comment

Choose a reason for hiding this comment

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

LGTM

@spydon spydon merged commit cdb2650 into flame-engine:main Dec 12, 2021
@st-pasha st-pasha deleted the ps/random-controller branch March 17, 2022 04:02
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.

4 participants