I designed a score-based game where the player controls the car using a 9-axis IMU sensor.
In this game, I wanted to have 2 types of pop-ups:
- If the car being controlled by the sensor approaches a range of angles (i.e between 15 to 200 degrees), a pop-up to warn the user that he is going “off course” will appear.
- When the timer reaches 0, a pop-up to show that time is up.
Also, if there was connectivity detected within those 3 times, then an alert message to show that the mobile phone is back online.
Now the problem that I’m facing is when the car approaches the desired angle range, the pop up doesn’t go away even after the boundary condition has been fulfilled. Because of this, the pop up to indicate that time is up becomes hidden. Below is the code snippet.
I’m assuming that there is a boundary condition that I’m overlooking and I would really appreciate a second pair of eyes! Thanks!