phetsims / color-vision

"Color Vision" is an educational simulation in HTML5, by PhET Interactive Simulations.
http://phet.colorado.edu/en/simulation/color-vision
GNU General Public License v3.0
1 stars 7 forks source link

factor out commonality in ScreenView subtypes #44

Closed pixelzoom closed 10 years ago

pixelzoom commented 10 years ago

RGBScreenView and SingleBulbScreenView both have a head and a thought bubble. The thought bubble has been factored out into an odd bit of code in addThoughtBubble.js. But the head code is duplicated, and it's not clear to me why they are somewhat different.

Recommended to create a ColorVisionScreenView base type that contains everything that the 2 screens have in common. Then extend ColorVisionScreenView for the 2 screens.

aaronsamuel137 commented 10 years ago

The heads are a little different, as mentioned in #59, but I have factored out the thought bubbles as well as the reset all, play/pause, and step buttons into ColorVisionScreenView.

Assigning to @pixelzoom for review

pixelzoom commented 10 years ago

Looks good, closing.