code-dot-org / dance-party

Renderer for the Dance game type. Based on p5.js and p5.play.js.
https://code-dot-org.github.io/dance-party/
13 stars 13 forks source link

[HOC Dance Party] Add new background effects to Dance Party from Poetry #654

Closed fisher-alice closed 1 year ago

fisher-alice commented 1 year ago

This PR adds 4 new background effects to Dance Party. I will not add these to the background dropdown for the 'set background effect` yet. However, we can add these 4 effects to the possible inputs for the new 'Use AI to' block. The 4 background effects are:

These 4 were different enough from current Dance Lab effects to warrant adding them.

The first three are available as background effects in Poetry projects defined in backgroundEffects.js here, and the last one is a foreground effect in Poetry defined here in foregroundEffects.js.

I had to some updating of the code when adding the background effects to Effects.js and a little more modification when updating the 'starburst' foreground effect.

After update: Note that in the screencast I changed the Dance Party level property usesPreview to true so that the user can view the background effect even when the program is not running.

https://github.com/code-dot-org/dance-party/assets/107423305/b8e392fd-b4a4-4edd-88aa-abe0baeab3ce

Links

jira

Testing

I updated a unit test and added a handful of visual tests for the background effects. I uncommented the tests for 'smiling_poop' and 'hearts_red' since randomSeed(0) is called here in createBackgroundScreenshot.js before the background tests are run for consistent images.