Increase Score Function
Add a new function the functions group
Add a new function the functions group
Call it increaseScore
Call it increaseScore
Right click on the function and choose add parameter
Right click on the function and choose add parameter
Add 3 NUMBER parameters:
Add 3 NUMBER parameters:
x , y and points
x , y and points
If the Bonus timer is running we will multiply the points before adding them to score and displaying them.
If the Bonus timer is running we will multiply the points before adding them to score and displaying them.
Otherwise just add the points to score and start the Bonus timer and display the points
Otherwise just add the points to score and start the Bonus timer and display the points
We should call the increaseScore function when two fruits merge.
We should call the increaseScore function when two fruits merge.
Therefore we should call it from our processCollision function.
Therefore we should call it from our processCollision function.
Update the end of the processCollision function as shown
Update the end of the processCollision function as shown