This project transforms Little Fighter 2 into an interactive TikTok Live-style game where characters spawn dynamically based on external events (simulated TikTok gifts).
The system consists of three main components:
- Socket.IO Controller Server - Simulates TikTok Live gift events
- Game Engine - Modified LF2 with dynamic character spawning
- TikTok Integration Module - Connects the two via Socket.IO
Navigate to the controller directory and install Node.js dependencies:
cd tiktok-controller
npm installcd tiktok-controller
npm startThe controller will start on http://localhost:3000
Open the game in your browser:
open little-fighter-2/game/game.htmlOr navigate to: file:///path/to/little-fighter-2/game/game.html
The game will auto-start immediately (no menu navigation needed).
- Open the controller UI in your browser:
http://localhost:3000 - Enter a username (or leave empty for "Anonymous")
- Click any gift button to spawn a character
| Gift Name | Character |
|---|---|
| Rosa | Bandit |
| Tiny Diny | Deep |
| Pumpkin Latte | John |
| Gutab | Henry |
| Fruit Plate | Rudolf |
| Heart Gaze | Louis |
| Tiny Diny in Love | Firen |
| Perfume | Freeze |
| S Flowers | Dennis |
| Tiny Diny Hotdog | Woody |
| Dombra | Davis |
- Gift Event: User clicks a gift button in the controller UI
- Socket.IO Broadcast: Server broadcasts the gift event to all connected clients
- Event Handler: Game receives the event via
tiktok-integration.js - Character Spawn:
match.spawn_ai_character()is called with character ID and username - AI Character: Character spawns at a random position with AI controller
- Label Display: Username label appears below the character
To disable auto-start and TikTok integration, add ?tiktok=false to the URL:
file:///path/to/little-fighter-2/game/game.html?tiktok=false
Edit game/game.js and modify the serverUrl parameter:
serverUrl: "http://your-server:3000";LF/match.js- Addedspawn_ai_character()method and task handlerLF/tiktok-integration.js- NEW: Socket.IO client and event handlerLF/label-renderer.js- NEW: Character label renderinggame/game.js- Added auto-start and TikTok integration initializationgame/game.html- Added Socket.IO client librarygame/autostart-config.js- NEW: Default game configuration
tiktok-controller/server.js- NEW: Socket.IO servertiktok-controller/public/index.html- NEW: Controller web UItiktok-controller/package.json- NEW: Dependencies
- Characters spawn with Team 1 (enemies)
- AI controller is automatically assigned
- Labels are stored in character
display_nameproperty - Socket.IO runs on port 3000 by default
- Game auto-starts after 500ms delay
- Real TikTok Live API integration
- Character label rendering on canvas
- Team assignment based on gift value
- Character despawn after timeout
- Gift combo effects
- Sound effects for spawns