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

fix quads #594

Closed ajpal closed 5 years ago

ajpal commented 5 years ago

There were two issues here- not resetting state and creating additional sprites

  1. I added a reset function to the Effect and called it from p5.dance.reset() I think this is a pattern we should follow for all backgrounds that have state to clean up, rather than the current practice of doing that cleanup work at the beginning of the next init()

  2. The all dancers do move block used this.p5_.allSprites, but this background creates 12 additional sprites (4 edges, 8 vertices). Then when we tried to change the animation for these sprites, it failed with: image Fixed by setting isDancer to true for all dance sprites when we create dancers, then filtering this.p5_.allSprites to only include dancer sprites for all dancers do more

Nov-14-2019 16-18-25

codecov-io commented 5 years ago

Codecov Report

Merging #594 into master will increase coverage by 0.02%. The diff coverage is 26.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #594      +/-   ##
==========================================
+ Coverage   31.36%   31.39%   +0.02%     
==========================================
  Files          28       28              
  Lines        3931     3937       +6     
==========================================
+ Hits         1233     1236       +3     
- Misses       2698     2701       +3
Impacted Files Coverage Δ
src/Effects.js 34.98% <0%> (-0.08%) :arrow_down:
src/p5.dance.js 84.1% <80%> (-0.06%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update a9b105a...5304fa0. Read the comment docs.

joshlory commented 5 years ago

Rad, thanks for fixing!

screensaver