These functions are:
- Movement01: The minimal robot. Does absolutely nothing at all.
- Movement02: Move forward a total of 50 pixels per turn. If you hit a wall, reverse direction.
- Movement03: Each turn, move forward a total of N pixels per turn, then turn left. N is initialized to 10, and increases by 10 per turn.
- Movement04: Move to the center of the playing field and stop.
- Movement05: Move to the upper left corner. Then move to the lower right corner. Then move to the upper right corner. Then move to the lower left corner.
- Movement06: Move to the center, then move in a circle, ending up where you started.
- Tracking01: Pick one enemy and follow them.
- Tracking02: Pick one enemy and follow them, but stop if your robot gets within 20 pixels of them.
- Tracking03: Each turn, Find the closest enemy, and move in the opposite direction by 100 pixels, then stop.
- Firing01: Sit still. Rotate gun. When it is pointing at an enemy, fire.
- Firing02: Sit still. Pick one enemy. Only fire your gun when it is pointing at the chosen enemy.
- Firing03: Sit still. Rotate gun. When it is pointing at an enemy, use bullet power proportional to the distance of the enemy from you.
- Firing04: Sit still. Pick one enemy and attempt to track it with your gun. In other words, try to have your gun always pointing at that enemy. Don't fire.
All in all I thought that it was a fun assignment. As challenging as it is, I think that this is a good exercise for us not only to use open source materials but to apply different fields such as Math as tools needed in programming. My ideas for a competitive robot will most definitely involve Math since I plan to focus on movement and targeting.
My sample code can be found here.
0 comments:
Post a Comment