Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Open more actions menu

Repository files navigation

MPGLite

A simple Python multiplayer game engine

v0.1.0 BETA

Tests Status

MPGLite is a lightweight Python multiplayer game engine built on the websockets library. Its goal is to enable Python beginners and developers unfamiliar with async/await or asyncio to easily and quickly create simple multiplayer games. Have you ever created a simple game and wondered if you could make it multiplayer? Then this might be the right library for you. MPGLite is designed so you have to write as few additional code as possible, handles repetitive and complex tasks, taking the weight off your shoulders. However, it is not for handling robust multiplayer games or thousands of players.

Table of Contents

Features

  • Server and client side
  • Built-in "room" functionalities
  • Easy communication between the server and clients
  • Simple callback implementation
  • Customizable for any game.

Hello, Server!

Here's a simple example of a client greeting the server:

server.py

from mpglite.server import Server

def message_received(message):
    print("Message received:", message)

server = Server(
    "localhost",
    8765,
    on_message=message_received
)
server.start()

client.py

from mpglite.client import Client

client = Client("localhost", 8765)
client.connect()

client.send("Hello, Server!")

Installation

pip install mpglite

About

Simple Python multiplayer game engine using WebSocket.

Topics

Resources

Code of conduct

Contributing

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.