Skip to content
Snippets Groups Projects
Commit 01b52264 authored by David Bergström's avatar David Bergström
Browse files

Add code example for DoNothingBot

parent 401c04f8
No related branches found
No related tags found
No related merge requests found
...@@ -14,6 +14,38 @@ Key differences: ...@@ -14,6 +14,38 @@ Key differences:
* Everything is built using cmake, allowing for one Visual studio project to * Everything is built using cmake, allowing for one Visual studio project to
build PyCommandCenter together with all its dependencies 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) # How to build (Windows)
First you need to make sure you got all the build dependencies: First you need to make sure you got all the build dependencies:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment