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

Initial commit

parents
No related branches found
No related tags found
No related merge requests found
# Compiled Python code
__pycache__/
# You should download the library file, not store it in version control
*.pyd
*.pyc
# files in .idea/
workspace.xml
usage.statistics.xml
tasks.xml
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.6" project-jdk-type="Python SDK" />
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/starcraft-ai.iml" filepath="$PROJECT_DIR$/.idea/starcraft-ai.iml" />
</modules>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$" isTestSource="false" />
</content>
<orderEntry type="jdk" jdkName="Python 3.6" jdkType="Python SDK" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
<component name="TestRunnerService">
<option name="PROJECT_TEST_RUNNER" value="Unittests" />
</component>
</module>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>
\ No newline at end of file
# StarCraft II bot
## Setup for creating your own bot
Start of by forking this repository by pressing the fork button above, this
will create your own copy of this repository.
This will bring you to your own version of this page.
Next you want to clone the new repository using the following command: `git
clone <path>`, where `<path>` is the url to the right of the fork button you
just pressed. If you have configured ssh-access use the ssh link, otherwise use
the http link.
Next, download the library binary from this page: (link)
Put the library in the folder git repository you just downloaded.
main.py 0 → 100644
import os
from library import *
class MyAgent(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 = MyAgent()
# bot2 = MyAgent()
participant_1 = create_participants(Race.Terran, bot1)
# participant_2 = create_participants(Race.Terran, bot2)
participant_2 = create_computer(Race.Random, Difficulty.Easy)
coordinator.set_participants([participant_1, participant_2])
coordinator.launch_starcraft()
path = os.path.join(os.getcwd(), "maps", "InterloperTest.SC2Map")
coordinator.start_game(path)
while coordinator.update():
pass
if __name__ == "__main__":
main()
File added
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment