Game for TikTok LIVE, version 1.0.0

Type a country. Last one bouncing wins.

A physics battle royale for your TikTok LIVE. Your chat drops country balls into a neon ring, gifts send bombs that break the wall, and the last country left takes the win.

$12 one-time, Tools License. Self-hosted, no monthly fee.

Country Bounce portrait game canvas: country balls with viewer names bounce inside a neon ring, under the win leaderboard and the Alive, timer, Next Spawn and bomb counters

Countries 190+

Gifts mapped 400+

Canvas 1080x1920

Viewers type a country name or code in your LIVE chat, and their ball drops into the ring with their username on it.

Two rules, printed on the canvas

The game shows viewers how to join and how to attack, right above the ring.

Type COUNTRY = SPAWN

A country name or its two-letter code, in any case: Indonesia, indonesia, ID or id. Many countries also match another spelling, such as Brasil, Kanada or Tiongkok. Each viewer gets one ball per match, labelled with their username.

GIFT = SPAWN BOMB

Each gift in the Gift Manager adds its value in bombs, times how many were sent, and over 400 gifts come mapped. Bombs knock pieces out of the ring, and balls that bounce out through a gap are out.

Viewers from the same country play on the same side. When only one country has balls left in the ring, it takes the win.

Top of the game canvas: the win leaderboard led by Indonesia with 7 wins, the Type COUNTRY = SPAWN and GIFT = SPAWN BOMB panel, and the Alive, timer, Next Spawn and bomb counters
On the canvas, the rules sit beside the win leaderboard and the Alive, timer, Next Spawn and bomb counters.

One match, six phases

The game runs every match on its own, from the first comment to the winner screen. These are frames from the 1080 x 1920 canvas.

  1. Waiting phase: an empty neon ring behind the words Waiting for players, with the win leaderboard and every counter at zero

    Phase 1

    Waiting

    Until the first ball

    The ring stays empty until a comment names a country. After 20 seconds with nobody, a bot joins so the stream never stalls.

  2. Pre-Spawn phase: a large 14-second countdown over the ring with the line Type your COUNTRY name or code to join

    Phase 2

    Pre-Spawn

    15 seconds

    The first ball opens a 15-second lobby. The screen asks viewers to type their country name or code, and anyone can still join.

  3. Get Ready phase: country balls with player names packed in the ring behind a 9-second countdown

    Phase 3

    Get Ready

    10 seconds

    A last countdown, with the countdown sound on every second. If fewer players than the minimum have joined, 5 by default, bots fill the open slots.

  4. Battle phase: 18 country balls bouncing inside the ring, with an opening in the wall and 18 seconds on the timer

    Phase 4

    Battle

    20 seconds

    The balls start moving and bounce off each other and the wall. A bomb flies in every 5 seconds and gifts send more. New comments now wait for the next match, counted under Next Spawn.

  5. Chaos phase: the wall broken into pieces, balls escaping the ring and the timer replaced by the word CHAOS

    Phase 5

    Chaos

    Until a winner

    If more than one country survives Battle, the opening in the wall gets wider and every ball speeds up. Balls that fly out are eliminated, and Alive counts who is left.

  6. Phase 6

    Winner

    Then a new match

    The last country left gets a win screen with its flag and the player's name, and a win on the leaderboard. Queued comments spawn into the next match.

Your control room

A password-protected admin panel at localhost:5000/admin runs the game from your browser. No code editing needed.

Admin panel TikTok Live Integration tab with a Disconnected badge, a username field, an auto-connect option and Connect and Disconnect buttons
Enter your TikTok username, save it and press Connect once you are live. A status badge shows the connection, and you can have it connect on its own when the server starts.
Game Master tab with a Mass Spawn field, a grid of country flags and a grid of TikTok gifts to simulate
Click any flag to spawn that country, mass-spawn random countries or simulate a gift. The same tab sets the maximum balls per arena and the minimum players, and holds Start Battle, Reset Area and Reset Leaderboard.
Gift Coin Manager table listing Adam's Dream, Air Dancer, Alien Buddy, Amusement Park and Animal Band with their values and Test and Delete buttons
Every gift name has a value that sets how many bombs it sends. Change a value, test a gift, delete it, or add a new one and save the mapping.
Audio SFX Configuration tab with Collision, Bomb, Win and Countdown cards, each with a file picker, a volume slider and a Test Sound button
Collision, Bomb, Win and Countdown each take your own .mp3, .wav or .ogg file up to 5 MB, with a volume slider and a Test Sound button.
Security tab with current password and new password fields and a Change Password button
The panel sits behind a password you can change here. Panel actions are CSRF-protected, and resets and deletes ask for confirmation first.

From download to live in five steps

  1. Step 1

    Install Python 3.9+

    On Windows, tick Add Python to PATH in the installer. On macOS and Linux, use your package manager.

  2. Step 2

    Extract the files

    Unzip the download and open a terminal in the Source folder.

  3. Step 3

    Install the dependencies

    Run pip install -r requirements.txt. It installs Flask, Flask-SocketIO, Flask-Cors and TikTokLive.

  4. Step 4

    Start the server

    Run python app.py. When the terminal shows COUNTRY BOUNCE SERVER STARTING, it is running. Keep it open while you stream.

  5. Step 5

    Add to OBS and connect

    Add a Browser source at localhost:5000 sized 1080 x 1920, go live, then open localhost:5000/admin and connect your TikTok username.

pip install -r requirements.txt
python app.py

Requirements

Operating system
Windows 10 or 11, macOS or Linux
Python
3.9 or newer
Streaming software
OBS Studio, Streamlabs or any software with a Browser Source
Admin panel browser
Chrome, Edge or Safari
Internet
Needed for the TikTok LIVE connection
TikTok
An account that is live while the game is connected

Pay once, host it yourself

Country Bounce is sold on CodeCanyon under its Tools License, which covers one user and unlimited end products. It runs on your own PC or VPS with Python, Flask and Socket.IO, so there is no subscription and no overlay service in between.

  • Full Python (Flask and Socket.IO) and JavaScript source code
  • Admin panel with TikTok, Game Master, Gift Manager, Audio SFX and Security tabs
  • 190+ country flags and a 400+ gift mapping catalogue
  • Sample sound effects for collision, bomb, win and countdown
  • Documentation for install, OBS, TikTok, branding and troubleshooting

Good to know

The live connection reads TikTok's public LIVE data through the open-source TikTokLive library. It is not an official TikTok API, so changes on TikTok's side, including policies and rate limits, can affect it at any time. Depending on your account, region or traffic, the library may also need a third-party signing service, and some of those charge for heavier use. Country Bounce is an independent product and is not affiliated with, endorsed by or sponsored by TikTok or ByteDance.

Tools License, CodeCanyon

$12

One-time payment

  • Full source code
  • Free updates through your Envato account
  • Item support through CodeCanyon
  • Documentation included
Buy on CodeCanyon (opens in a new tab)

Questions before you buy

Do I need coding experience?

No. You install Python once and run two commands. The TikTok connection, gift mapping, game rules and sounds are all set in the browser admin panel.

What do viewers type to join?

A country name or its two-letter code, in any case, so Indonesia, indonesia, ID and id all work. Over 190 countries are included, and each viewer gets one ball per match.

How do gifts become bombs?

Each gift name in the Gift Manager has a value. Sending that gift adds that many bombs to the queue, multiplied by how many were sent. Over 400 gifts are mapped out of the box, and you can add, edit, test or delete any of them. A bomb also drops every 5 seconds during Battle and Chaos.

What happens if nobody joins?

After 20 seconds without a comment, the game spawns a bot to open the lobby. If real viewers do not reach the minimum player count, 5 by default, bots fill the remaining slots so the match still starts.

Why is the TikTok connection not working?

The connection only works while you are live. Start your TikTok LIVE first, then click Connect in the admin panel, and type your username exactly as it appears, without the @ symbol. The connection drops when the live stream ends.

What size should the OBS browser source be?

Point a Browser source at http://localhost:5000/ with a width of 1080 and a height of 1920. Tick Control audio via OBS if you want to set the game volume from OBS. Streamlabs and other software with a Browser Source work the same way.

What happens if OBS reloads the page?

The match carries on. The current phase, timer, leaderboard and balls in play are saved on the server, so a reload of the browser source resumes the match instead of starting over.

Can I test it without going live?

Yes. The Game Master tab spawns any country with a click, mass-spawns random countries and simulates gifts. These run the same game logic as real comments and gifts, so you can play a full match before your stream.

Can I run it on a VPS?

Yes. It runs on your own PC or a VPS with Python 3.9 or newer. On a VPS, point the OBS browser source at your server address instead of localhost.

Can I change the look and the sounds?

Yes. The Audio SFX tab takes your own .mp3, .wav or .ogg file, up to 5 MB, for each of the four sounds. The documentation shows where to change the page titles, the admin and HUD colours and the font, and how to add your own logo.

Can I get a refund?

Refunds follow the Envato Market refund rules on CodeCanyon. They cover items that are not as described, do not work and cannot be fixed, have an unpatched security issue, or come without the promised support, within 180 days for supported CodeCanyon items. A change of mind is not covered. Contact us first so we can try to fix the problem.

What does the purchase include?

The full Python and JavaScript source code, the admin panel, 190+ country flags, the 400+ gift mapping catalogue and the documentation, under the CodeCanyon Tools License with item support through CodeCanyon.

Put your chat in the ring

One purchase of $12, running on your own machine. Read the documentation first if you want to check every step.