domingo, 13 de janeiro de 2013

Opponents

09th, 12th-13th Jan 2013 - The 20th meeting was about finishing the routing and starting to talk about the opponents. We started with the simplest one, how to register the Toaster position in our world. 20th and 21st we worked on the Toaster and started about the Mold programming.






 


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


The mold is the most problematic character because it moves. And the way it moves diagonally is different from how the robot moves. We need the robot know about it, so it can plan its moves safely, but we can't use existing code

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