-
Notifications
You must be signed in to change notification settings - Fork 1
Running First Game
instructions on how to run first game can be found here
import Robocup as RC #Do Not edit this line
def selectSkill(world_data): #Do Not edit this line
robocup = RC.Robocup(world_data) #Do Not edit this line
if robocup.playerNumber() == 1:
return robocup.STAND()
else:
if robocup.gameSide() == 0:
return robocup.HARD_KICK(robocup.GOAL_LEFT_CENTRE_X +0.1,robocup.GOAL_LEFT_CENTRE_Y)
else:
return robocup.HARD_KICK(robocup.GOAL_RIGHT_CENTRE_X -0.1,robocup.GOAL_RIGHT_CENThe above is example code showing a single 2 player team, where player 0 acts as goalie and player 1 goes ahead to score a goal.
In your verison, do not edit the first 3 lines, these are necessary for running a game.
You must always return a skill from the robocup class. See provided documentation for the Robocup class in Robocup.py for a list of these skills, and how to call on them.
The above mentioned documentation provides a detailed list of the rest of the class and how to use it. See also the original documentation.
To return a specific skill, use the following format:
return robocup.<YOUR CHOSEN SKILL>Often the singularity fails to notify you if your python code is not compiling/running correctly, use sandbox.py to quickly check if your code is able to run.
To use the sandbox: Navigate to the Behaviors folder in the Code_Base with your terminal, then run the following line in terminal:
python sandbox.py
This checks your selectSkill() function in strategyPy.py against a single instance of world model data to see if it is returning a skill correctly. It will also reveal any syntax errors or bugs in your code.