phetsims / vegas

Reusable game components for PhET simulations.
MIT License
1 stars 4 forks source link

GameTimer doesn't increment elapsed time #57

Closed pixelzoom closed 7 years ago

pixelzoom commented 7 years ago

This is a bug that was introduced during the conversion from PropertySet to Property in https://github.com/phetsims/vegas/commit/6660bbb0c4c0bd9e942c2630eea48ffe1d7dd2e2 on 11/3/2016. It was noticed by @phet-steele in https://github.com/phetsims/graphing-slope-intercept/issues/12#event-1030792871 and affects all sims that use GameTimer, including:

area-builder arithmetic balancing-chemical-equations graphing-lines graphing-slope-intercept reactants-products-and-leftovers

The symptom is that the clock shown in the scoreboard will not increment.

pixelzoom commented 7 years ago

Conversion of both elapsedTimeProperty and isRunningProperty were handled incorrectly. Client code in the above sims that still reference elapsedTime and isRunning will need to be fixed.

@jbphet I'll be making changes to 2 of your sims: arithmetic and area-builder. If you've published either of these sims since 11/3/2016, they may contain this bug.

phet-steele commented 7 years ago

@pixelzoom I'm not actually seeing this problem in area-builder. I do see the problem everywhere else you mentioned.

pixelzoom commented 7 years ago

area-builder doesn't seem to show time anywhere in the user interface. But it's definitely a problem in the code.

phet-steele commented 7 years ago
screen shot 2017-04-05 at 12 04 08 pm
pixelzoom commented 7 years ago

Ah, sorry, I hadn't turned the clock on when testing area-builder. Area Builder is very odd. It uses GameTimer, but QuizGameModel is a PropertySet with its own elapsedTime Property. (@jbphet)

NOTE: Discussed with @jbphet. Area Builder is using GameTimer only for formatting the time. So not affected by this bug.

pixelzoom commented 7 years ago

The good news is that none of these sims appears to have been published with this bug.

pixelzoom commented 7 years ago

I reviewed arithmetic with @jbphet. Running with ?autoAnswer allowed me to get to the "game completed" screen to verify that the time looks correct.

pixelzoom commented 7 years ago

@phet-steele could do a quick verification of these sims in master? Thanks.

phet-steele commented 7 years ago

Verified!