TicTacToe Extension
Version: 8
Category: Extension
Visibility: Non-Visible
Developer: Idriss (using Fast-CLI, adapted for MIT App Inventor)
Size: 17Kb
Date: March 27, 2025
Update: March 28, 2025
๐น Overview
TicTacToe Extension is a powerful extension now compatible with MIT App Inventor, allowing you to create a fully functional Tic Tac Toe game within your apps. It features a stylish 3x3 grid with square buttons, customizable images for X and O, background options, and an AI bot with three difficulty levels (Noob, Medium, Pro). Designed for both Player vs. Player (PvP) and Player vs. Bot (PvB) modes, itโs perfect for developers aiming to add an engaging and interactive game to their MIT App Inventor projects!
โ Key Features
- ๐จ Customizable Design: Set button colors, text colors, and background color/image.
- ๐ผ๏ธ Image Support: Use custom X and O images from assets.
- ๐ค AI Bot: Choose from three difficulty levels (Noob, Medium, Pro) for single-player mode.
- ๐ Score Tracking: Track X wins, O wins, and ties with event feedback.
- ๐ฌ Animations: Button click animations for a smooth user experience.
- ๐ฎ Flexible Gameplay: Supports both PvP and PvB modes.
๐ ๏ธ Functions & Usage
Core Properties:
- SetButtonColor(int color): Sets the default button background color.
- SetTextColor(int color): Sets the text color for X/O (if no images).
- SetBackgroundColor(int color): Sets the background color.
- SetXImage(String path): Sets the X image from assets.
- SetOImage(String path): Sets the O image from assets.
- SetBackgroundImage(String path): Sets the background image from assets.
Setup & Display:
- Create(VerticalArrangement component): Creates the game board in a VerticalArrangement (MIT App Inventor compatible).
- RestartGame(): Resets the game board and scores.
- GameFinished(String lastWinner, int xScore, int oScore, int ties): Event triggered when the game ends.
Customization:
- EnableBot(boolean enable): Enables or disables the bot (O player).
- SetBotLevel(String level): Sets the bot difficulty (Noob, Medium, Pro).
- IsBotEnabled(): Returns true if the bot is enabled, false otherwise.
๐ How It Works (Step-by-Step Guide)
- Step 1: Import the TicTacToe Extension (.aix) into your MIT App Inventor project.
- Step 2: Customize the game with
SetButtonColor
,SetXImage
, etc. - Step 3: Enable the bot using
EnableBot
and set difficulty withSetBotLevel
(optional). - Step 4: Call
Create
with a VerticalArrangement component. - Step 5: Handle the
GameFinished
event to display results or proceed.
*** Example Blocks
Below are example blocks showing how to use TicTacToe Extension in your MIT App Inventor 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 video demonstrates the Tic Tac Toe game with a bot enabled, custom X/O images, and the GameFinished
event showing results in MIT App Inventor.
๐ Events & Error Handling
- GameFinished(String lastWinner, int xScore, int oScore, int ties): Triggered when the game ends with winner and scores.
Note: Ensure the game completes (win or tie) for the event to return values.
๐ ๏ธ Troubleshooting & Common Issues
โ ๏ธ "GameFinished event not returning values"?โ Ensure the game ends (win/tie) and check your blocks for proper event handling.
"Bot not playing"?
โ Verify EnableBot
is true and SetBotLevel
is set correctly.
"Images not loading"?
โ Check asset paths for SetXImage
and SetOImage
(.png, .jpg supported).
๐ Why Use This Extension?
โ Engaging Game: Add a fun Tic Tac Toe experience to your app.โ Highly Customizable: Tailor the design to fit your appโs style.
โ Easy Integration: Simple blocks and events for quick setup.
โ Flexible Modes: Supports both PvP and PvB gameplay.
๐ Over 12 Blocks ๐
Whatโs New in Version 8
- Click Protection: Fixed a problem where clicking two buttons at once could mess up the game. Now, it locks after each click so only one move happens at a time, making it fair and smooth.
- Phone Size Support: Added support for all phone sizes, so the game looks good and works well no matter what device youโre using.
Version: 8
Category: Extension
Visibility: Non-Visible
Developer: Idriss (using Fast-CLI, adapted for MIT App Inventor)
Size: 17Kb
Date: March 27, 2025
Update: March 28, 2025
Extension Support for MIT App Inventor
๐ Enjoy using TicTacToe Extension in MIT App Inventor! Share your feedback & suggestions below. ๐๐ฐ Purchase TicTacToe Extension: Get the full version of TicTacToe Extension for just 3 USD via PayPal. If you donโt have money, Iโll provide it to you for freeโcontact me! Click the link below to make your payment:
๐ฉ After Payment: Contact me on Telegram or via email to receive your extension file. Provide your payment details for verification.
Telegram: @IdrissCAma