Toaster in my world
We already had functions to detect the opponents with the sonar. The only thing we didn't discussed properly was how to register it in the map. The Toaster character means that if anyone falls into it, will lose turns once. It's not a fatal thing. And it may be that only move possible for escaping the mold.
Thus we decided to save its position in a variable apart and mark that position as visited on the map. This way it will normally avoid going in there, but in panic case it's always usable by resetting it to 1 (not visited).
The scary Mold
After the robot knows the exact position where the Mold is, it will determine what are the moves it can do. The robot will be able to avoid those positions while calculating the next move towards the target.
After calculating his own move, it will then assume the next Mold position. And go on until it finds the target. If that's not possible, the calculation should regress as in the Dead End situation.
Nonetheless, we'll always be testing the Mold position because he may be caught in the Toaster and get behind. Or vice-versa.
Sem comentários:
Enviar um comentário