Time for action – updating and displaying ScoreZooms
Add a
Queue
object to theGame1
class to hold activeScoreZooms
:Private ScoreZooms as Queue(Of ScoreZoom) = new Queue(Of ScoreZoom)()
Add a new helper method to the
Game1
class to update theScoreZooms
queue:Private Sub UpdateScoreZooms() Dim dequeueCounter as Integer = 0 For Each zoom as ScoreZoom in ScoreZooms Zoom.Update() If (zoom.IsCompleted) Then dequeueCounter += 1 End If Next For d as Integer = 0 to dequeueCounter - 1 ScoreZooms.Dequeue() Next End Sub
In the
Update()
method, inside the case section forGameState.Playing
, add the call to update any activeScoreZooms
. This can be placed right before the case'sEnd Select
statement:UpdateScoreZooms()
Add the following to the
CheckScoringChain()
method to create aScoreZoom
when the player scores. Add this right after theplayerScore
is increased:ScoreZooms.Enqueue(new ScoreZoom("+" + DetermineScore(WaterChain.Count)...