diff --git a/README.md b/README.md index acd957b4eb7c923c7eda5126668182951d864f61..a42d5f8375a7a17f7b96a0e3aaa9d7f7baf6c7e1 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,38 @@ Key differences: * Everything is built using cmake, allowing for one Visual studio project to build PyCommandCenter together with all its dependencies +# Code example for making a bot: + +``` python +from library import * + +class DoNothingBot(IDABot): + def __init__(self): + IDABot.__init__(self) + + def on_game_start(self): + IDABot.on_game_start(self) + + def on_step(self): + IDABot.on_step(self) + + +def main(): + coordinator = Coordinator() + bot1 = DoNothingBot() + + participant_1 = create_participants(Race.Terran, bot1) + participant_2 = create_computer(Race.Random, Difficulty.Easy) + + coordinator.set_participants([participant_1, participant_2]) + + coordinator.launch_starcraft() + coordinator.start_game("InterloperTest.SC2Map") + + while coordinator.update(): + pass +``` + # How to build (Windows) First you need to make sure you got all the build dependencies: