I have a score, and if the player receives a 3 or 4 score (from racing laps), they get a small trophy; 5 , 6 or 7, they get a medium trophy, 8 or 9, a big trophy and 10+ a big trophy. I'm testing if a LocalStorage value is smaller than a lap, and if the value written in LocalStorage is lower than the lap, the trophy is shown. This works well, since if the player is replaying a level and they receive a lower score, it still retrieves and shows their highest won trophy ever for the level. When the get a higher lap than is saved in LocalStorage, it writes the higher score to localstorage and shows the new, bigger trophy. I also have a failsafe wheby is the the LocalStorage key doesn't exist, it writes the current lap to it regardless.
Now, the problem is, I can't think of how to play a "tadah" sound the FIRST time the player wins the trophy. It has a tendency whatever I write to play the "tadah" sound upon retrieving the score from LocalStorage and displaying the trophy that has been won in the past. Any clue what kind of LapCount/LocalStorageValue test I would have to perform to make sure the "tadah" sound only plays the first time the play wins the trophy?