[Free/Paid] TicTacToe Extension: creates a fully functional Tic Tac Toe game

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

:small_blue_diamond: 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.

:small_blue_diamond: 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.

:small_blue_diamond: 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)

  1. Step 1: Import the TicTacToe Extension (.aix) into your MIT App Inventor project.
  2. Step 2: Customize the game with SetButtonColor, SetXImage, etc.
  3. Step 3: Enable the bot using EnableBot and set difficulty with SetBotLevel (optional).
  4. Step 4: Call Create with a VerticalArrangement component.
  5. Step 5: Handle the GameFinished event to display results or proceed.

*** Example Blocks

image
image


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.

image

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.

image

:warning: "Bot not playing"?

โ†’ Verify EnableBot is true and SetBotLevel is set correctly.

image

:warning: "Images not loading"?

โ†’ Check asset paths for SetXImage and SetOImage (.png, .jpg supported).

image


๐Ÿš€ 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 ๐Ÿš€

Create_Method
EnableBot_Set_Property
GameFinished_Event
IsBotEnabled_Method
RestartGame_Method
SetBackgroundColor_Set_Property
SetBackgroundImage_Set_Property
SetBotLevel_Method
SetButtonColor_Set_Property
SetOImage_Set_Property
SetTextColor_Set_Property
SetXImage_Set_Property

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

1 Like

Good job. but with this extension, there is much less the fun of coding, since you have done most of work.

2 Likes

Thanks for the feedback, I get what you mean using an extension like this can take away some of the coding fun since it handles a lot of the heavy lifting for you. My goal was to make a ready to use Tic Tac Toe game so you can focus on other creative parts of your app, like designing the UI or adding cool features around it. :wink:

Agreed, this was the fun way :

2 Likes

Agreed :stuck_out_tongue_closed_eyes:

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.
1 Like