A simple Minecraft-like multiplayer game built with Python, Pygame, and OpenGL.
- Multiplayer support with client-server architecture
- 3D world rendering with OpenGL
- Block placement and destruction
- Player movement and rotation
- Real-time player synchronization
- Custom player skins support
- Hotbar inventory system
The easiest way to start the game is using the provided run.bat file:
run.batThis will:
- Install dependencies
- Start the server
- Start two clients with predefined names:
- Client 1: Steve
- Client 2: Alex
python -m server.server# With default name "Player"
python -m client.client
# With custom name
python -m client.client Steve
# With custom name and host
python -m client.client Steve localhostYou can also use run_client.bat to start a single client:
# Default name "Player"
run_client.bat
# Custom name
run_client.bat Steve
# Custom name and host
run_client.bat Steve localhost- WASD: Move
- Mouse: Look around
- Left Click: Break blocks
- Right Click: Place blocks
- Mouse Wheel: Change selected block
- 1-9: Select hotbar slot
- F5: Toggle third-person view
- Escape: Toggle mouse lock
- Ctrl: Sneak
You can specify player names and server host via command line arguments:
python -m client.client [player_name] [host]Examples:
python -m client.client Steve- Connect as "Steve" to localhostpython -m client.client Alex 192.168.1.100- Connect as "Alex" to server at 192.168.1.100
- Player Name: "Player" (fallback if not specified)
- Server Host: "localhost" (fallback if not specified)
- Server Port: 9999 (fixed)
pycraft/
├── assets/ # Game assets (textures, etc.)
├── client/ # Client-side code
│ ├── client.py # Main client
│ ├── input.py # Input handling
│ ├── inventory.py # Inventory system
│ └── render.py # OpenGL rendering
├── server/ # Server-side code
│ ├── server.py # Main server
│ ├── player.py # Player management
│ └── world.py # World generation
├── shared/ # Shared code
│ ├── constants.py # Game constants
│ └── packets.py # Network packets
├── run.bat # Start server + 2 clients
├── run_client.bat # Start single client
└── generate_assets.py # Asset generation
Install required packages:
pip install -r requirements.txtAssets are automatically generated when running the game, but you can also generate them manually:
python generate_assets.pyPlace a custom skin file at assets/player_custom.png to use it instead of the default player texture.
The game uses a custom binary protocol for client-server communication. See shared/packets.py for packet definitions.
This project is open source. See LICENSE file for details.