Red puck "smart"/learning logic:
Every 10 seconds, the Red puck checks the following...
- Have I scored?
- Has the Blue puck scored?
If the Red puck has scored in the previous 10 seconds, the current speed and update rate seem to be working and it will keep these until the next check.
If the Red puck has not scored in the previous 10 seconds and the Blue puck has, the Red puck will increase its speed by 100 (up to a max of 2000) and shorten its update rate by 0.1sec (to a minimum of every 0.1 seconds), in an attempt to chase the puck better.
If nobody has scored in the previous 10 seconds, the Red puck will reduce its speed by 100 (to a minimum of 500) and increase its update rate by 0.1sec (to a maximum of every second), in an attempt to find a different approach that allows it to score.