Class: AI

Stardash. AI

This is the class to play the Stardash game. This is where you should build your AI.

new Stardash.AI()

Methods

ended(won, reason)

This is called when the game ends, you can clean up your data and dump files here if need be.
Name Type Description
won boolean True means you won, false means you lost.
reason string The human readable string explaining why you won or lost.

gameUpdated()

This is called every time the game's state updates, so if you are tracking anything you can update it here.

string getName()

This is the name you send to the server so your AI will control the player named this string.
Returns: string
The name of your Player.

boolean runTurn()

This is called every time it is this AI.player's turn.
Returns: boolean
Represents if you want to end your turn. True means end your turn, False means to keep your turn going and re-call this function.

start()

This is called once the game starts and your AI knows its playerID and game. You can initialize your AI here.