TicTacToe - Two game modes: 2 players and AI. Custom Colors, Symbols and Stroke...

TicTacToe
Two game modes: 2 players and AI.
Custom Colors, Symbols and Stroke.


  • Play with a friend on the same device or face off against an artificial intelligence with varying difficulty levels.

    • (Integration with Google's Gemini AI models). This is optional.

Get your API key here:

https://aistudio.google.com/app/apikey


CreateBoard

Create the Tic Tac Toe board in an HVArrangement.


Restart

Restart the game.

component_method (13)


GameMode

Set the game mode (TwoPlayer or Ai).


AIDifficulty

Set the AI ​​difficulty (Easy, Medium, Hard).

Easy: 70% random moves, 30% smart moves.
Medium: 50% random, 50% smart moves.
Hard:

  • With API Key: Uses Gemini AI for strategic decisions.

  • Without API Key: Uses 100% of the internal intelligent logic.


PlayerSymbol

Set the player symbol (X or O) in Ai mode.


SymbolImages

Set images for X and O symbols.


ClearSymbolImages

Clear symbol images and return to using X and O.

component_method (11)


GeminiApiKey

Set the Gemini AI API Key


GeminiModel

Specify the Gemini AI model to use.

  • It supports multiple models: gemini-2.5-flash, gemini-2.0-flash, etc...

RemoveBoard

Remove the board from the container.

component_method (16)


Colors

Change the colors of the X and O.

blocks (46)


BackgroundColor

Sets the background color of the cells.


BorderColor

Set the color of the board border.


BorderWidth

Sets the border thickness.


Padding

Sets the padding (space from the edge) for the X and O.


StrokeWidth

Sets the line thickness for X and O.


WinLineColor

Set the color of the winning line.


WinLineWidth

Set the thickness of the winning line.


PlayerXScore

Get player X score

component_method (14)


PlayerOScore

Get player O score.

component_method (15)


CurrentPlayer

Gets the current player.

component_method (12)


IsGameActive

Check if the game is active.

component_method (17)


IsAIThinking

Check if the AI ​​is thinking.

component_method (18)


GameEnded

It triggers when a player wins.

component_event (14)


PlayerChanged

It triggers when the player changes.

component_event (13)


GameRestarted

It triggers when the game restarts.

component_event (18)


CellClicked

It is triggered when a cell is clicked.

component_event (15)


AIThinkingStarted

It triggers when the AI ​​starts to think.

component_event (16)


AIThinkingFinished

It fires when the AI ​​finishes thinking.


v1.0 March 11, 2026.

TicTacToe.aia (56.0 KB)

joejsanz.joedevtictactoe.aix (40.2 KB)


JDK: 11
Minimum API Level: 21
Updated On: 2026-03-11T07:00:00Z

Built using: FAST-CLI v5.7.0-premium


Thanks.

2 Likes