TicTacToe Extension
Version: 9
Category: Extension
Visibility: Non-Visible
Developer: Idriss (using Fast-CLI, adapted for Kodular)
Size: 23Kb
Date: March 27, 2025
Update: March 30, 2025
๐น Overview
TicTacToe Extension is a powerful and versatile extension for Kodular that brings a fully functional Tic Tac Toe game to your apps. Featuring a sleek 3x3 or 4x4 grid with customizable square buttons, it supports custom X and O images, background options, and an AI bot with three difficulty levels (Noob, Medium, Pro). Perfect for Player vs. Player (PvP) and Player vs. Bot (PvB) modes, this extension is designed for developers looking to integrate an engaging, interactive game into their projects with ease!
โ Key Features
- ๐จ Customizable Design: Adjust button colors, text colors, and background color/image.
- ๐ผ๏ธ Image Support: Use custom X and O images from assets for a personalized look.
- ๐ค Smart AI Bot: Select from three difficulty levels (Noob, Medium, Pro) for single-player fun.
- ๐ Score Tracking: Monitor X wins, O wins, and draws with event-based feedback.
- ๐ฌ Smooth Animations: Enjoy button click animations for an enhanced user experience.
- ๐ฎ Flexible Gameplay: Supports PvP and PvB modes with 3x3 and 4x4 board options.
- ๐ก๏ธ Click Protection: Locks moves after each click to prevent glitches and ensure fair play.
- ๐ฑ Universal Phone Support: Adapts seamlessly to all phone screen sizes.
๐ ๏ธ Functions & Usage
Core Properties:
- SetButtonColor(int color): Sets the default button background color.
- SetTextColor(int color): Sets the text color for X/O when images aren't used.
- SetBackgroundColor(int color): Sets the game background color.
- SetXImage(String path): Assigns a custom X image from assets.
- SetOImage(String path): Assigns a custom O image from assets.
- SetBackgroundImage(String path): Sets a background image from assets.
Setup & Display:
- Create(VerticalArrangement component, BoardType boardType): Builds the game board (3x3 or 4x4) in a VerticalArrangement.
- RestartGame(): Resets the board and scores to start a new game.
- GameFinished(String lastWinner, int xScore, int oScore, int ties): Event triggered when a game ends, providing winner and score details.
Customization:
- EnableBot(boolean enable): Toggles the bot (O player) on or off.
- SetBotLevel(BotLevel level): Sets bot difficulty to Noob, Medium, or Pro.
- IsBotEnabled(): Returns true if the bot is active, false otherwise.
- ConfigurePlayer(PlayerSymbol symbol, StartOption startOption): Sets player symbol (X or O) and starting mode (Player, Bot, or Auto).
Events:
- ButtonClicked(int position): Triggered when a button is clicked, returning its position.
- GetCurrentTurn(String currentTurn): Fired after each move or reset, indicating whose turn it is.
๐ How It Works (Step-by-Step Guide)
- Step 1: Import the TicTacToe Extension (.AIX) into your Kodular project.
- Step 2: Customize it using
SetButtonColor
,SetXImage
, etc. - Step 3: Optionally enable the bot with
EnableBot
and set its level withSetBotLevel
. - Step 4: Use
Create
with a VerticalArrangement and specify board size. - Step 5: Handle events like
GameFinished
andGetCurrentTurn
for game flow and results.
*** Example Blocks
Below are example blocks showing how to use TicTacToe Extension in your Kodular project:
Description: This example sets up a Tic Tac Toe game with a bot at "Medium" difficulty, custom X/O images, and triggers the GameFinished
event to display scores.
*** Video Test
Watch the video below to see TicTacToe Extension in action:
Description: This example sets up a Tic Tac Toe game with a bot at "Medium, Noob, Pro" difficulty, and triggers the GameFinished
event to display scores.
๐ Events & Error Handling
- GameFinished(String lastWinner, int xScore, int oScore, int ties): Fired when the game ends, returning the winner and scores.
- ButtonClicked(int position): Fired on button clicks, returning the clicked position (0 to board size - 1).
- GetCurrentTurn(String currentTurn): Indicates whose turn it is (e.g., "Player", "Bot", "Player X").
Note: Ensure the game ends (win or draw) for GameFinished
to return values.
๐ Why Use This Extension?
โ Engaging Gameplay: Brings a fun Tic Tac Toe experience to your app.โ Highly Customizable: Matches your appโs style with extensive design options.
โ Easy to Integrate: Simple blocks and events for fast setup.
โ Versatile Modes: Offers PvP and PvB with multiple board sizes.
๐ Over 15 Blocks ๐
APK TEST (.APK):
TicTacToeKODULAR.apk (4.6 MB)
Version: 9
Category: Extension
Visibility: Non-Visible
Developer: Idriss (using Fast-CLI, adapted for Kodular)
Size: 23Kb
Date: March 27, 2025
Update: March 30, 2025
Extension Support for Latest Kodular Update
๐ Enjoy using TicTacToe Extension! Share your feedback & suggestions below. ๐๐ฐ Purchase TicTacToe Extension: Get the full version of TicTacToe Extension for just 3 USD via PayPal. If you canโt afford it, Iโll provide it freeโcontact me! Click below to pay:
PayPal
๐ฉ After Payment: Reach out via Telegram or email with payment details to receive your extension file.
Telegram: @IdrissCAma