You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Elias Judin edited this page Jun 6, 2021
·
3 revisions
instructions on how to run first game can be found here
Tutorial
Coding your first team in python using strategyPy.py
importRobocupasRC#Do Not edit this linedefselectSkill(world_data): #Do Not edit this linerobocup=RC.Robocup(world_data) #Do Not edit this lineifrobocup.playerNumber() ==1:
returnrobocup.STAND()
else:
ifrobocup.gameSide() ==0:
returnrobocup.HARD_KICK(robocup.GOAL_LEFT_CENTRE_X+0.1,robocup.GOAL_LEFT_CENTRE_Y)
else:
returnrobocup.HARD_KICK(robocup.GOAL_RIGHT_CENTRE_X-0.1,robocup.GOAL_RIGHT_CEN
The 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: