Skip to main content
# Easy2D

Easy2D is a general-purpose 2D game framework for Python with an in-house backend API.

It is designed to support many kinds of 2D games: arcade, platformer, top-down, RPG-style, puzzle, shooter, story-driven, menu-heavy, multiplayer prototypes, and experimental projects.

## Install

```bash
pip install easy2d

Community

Need help, want to report a bug, or have an idea for a new feature?

Join the community Discord for support, updates, bug reports, and suggestions for Easy2D, AutoConfigPy, and other related libraries:

https://discord.gg/BuDs8jVQUP

Quick Start

import easy2d as e

game = e.Game("My Game", 960, 540, fps=120)

class MainScene(e.Scene):
    def __init__(self):
        super().__init__()
        self.player = self.add(e.Rect(100, 100, 32, 32, gravity=0.0, floor_y=None))
        self.title = self.add(e.Text("Hello Easy2D", 20, 20))
        self.button = self.add(e.Button("Play", 100, 100, 180, 50, on_click=self.play))

    def play(self):
        print("Play clicked")

game.set_scene(MainScene())
game.run()

Display and Fullscreen

game = e.Game(
    "Display Demo",
    960,
    540,
    fullscreen=False,
    resizable=True,
    vsync=True,
    scale_mode="fit",  # native | fit | stretch | pixel-perfect
)

game.toggle_fullscreen()
game.set_resolution(1280, 720)

UI

scene.add(e.Text("Settings", 30, 20, size=30))
scene.add(e.Panel(20, 50, 420, 260))
scene.add(e.Button("Apply", 40, 80, 170, 44, on_click=apply_settings))
scene.add(e.TextInput(40, 140, 240, 40, placeholder="Player name"))
scene.add(e.Checkbox(40, 200, text="Fullscreen"))
scene.add(e.Slider(40, 250, 220, min_value=0, max_value=100, value=75))

Sprites and Animation

player = e.Sprite("assets/player.png", 100, 100)
player.scale = 2
player.flip_x = True
player.rotation = 8

anim = e.AnimatedSprite(200, 100)
anim.add_animation("idle", ["idle1.png", "idle2.png"], fps=6)
anim.add_animation("run", ["run1.png", "run2.png"], fps=12)
anim.play("run")

Audio and Assets

game.assets.load_image("player", "assets/player.png")
game.assets.load_json("level", "assets/level1.json")
game.assets.load_font("main", size=24)

game.audio.load_sound("coin", "assets/coin.wav")
game.audio.play_sound("coin")
game.audio.play_music("assets/theme.mp3", loop=True)

Particles

fx = e.ParticleSystem.explosion()
fx.emit_burst(200, 200, count=40)

Networking Helpers

server = e.MultiplayerServer(port=5000)
server.start()
server.broadcast({"type": "chat", "text": "hello"})
messages = server.get_messages()

client = e.MultiplayerClient()
client.connect("127.0.0.1", 5000)
client.send({"type": "hello"})
inbox = client.get_messages()
client.disconnect()

# Authoritative server + rollback snapshots
auth = e.AuthoritativeGameServer(port=7777, tick_rate=60)
auth.start()

# Reliable UDP channel (ack/retry)
udp = e.ReliableUDPChannel(port=7001)
udp.start()

# Built-in matchmaking queue
mm = e.MatchmakingService()
mm.enqueue("player-1", region="us", mode="duel")
mm.enqueue("player-2", region="us", mode="duel")
matches = mm.poll_matches()

CLI

easy2d --help
easy2d --show-scope
easy2d --multiplayer
easy2d --multiplayer --port 7777
easy2d --host --port 5000
easy2d --join 127.0.0.1 --port 5000 --message "hello"
easy2d --net-test --port 5000
easy2d --list-examples
easy2d --write-example basic
easy2d --write-example ui
easy2d --write-example particles
easy2d --write-example multiplayer
easy2d --write-all-examples
easy2d new arcade MyGame
easy2d new topdown MyTopDown
easy2d new shooter MyShooter

Current Scope

  • Scene-based game loop
  • Camera follow/zoom/shake
  • Tilemaps with chunk caching
  • UI widgets
  • Sprite and basic animation classes
  • Particle systems
  • Audio and asset managers
  • Timer and tween helpers
  • Beginner-friendly multiplayer relay helpers
  • Authoritative game server framework
  • Reliable UDP transport with ack/retry
  • Rollback snapshot buffer utilities
  • Built-in matchmaking queues

Roadmap

  • Expanded physics and collision response
  • Sprite atlas/animation tools
  • Save/load helper utilities
  • Higher-level authoritative netcode patterns
  • Additional UI widgets and layout helpers

Metadata

Release files for easy2d 0.5.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for easy2d 0.5.2
File Size Uploaded Provenance Actions
easy2d-0.5.2.tar.gz 31.6 kB Without provenance Details for easy2d-0.5.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for easy2d 0.5.2
File Interpreter ABI Platform Actions
easy2d-0.5.2-py3-none-any.whl Python 3 none any Details for easy2d-0.5.2-py3-none-any.whl

Total release size: 71.8 kB

Release files / easy2d-0.5.2.tar.gz

Download URL easy2d-0.5.2.tar.gz
Size 31.6 kB
Tags Source
SHA-256 checksum
How to use checksums
8f030ff8022248e6999d9575af964582c58e195c15807dfb8b8ad7af59290bad
BLAKE2b-256 checksum
How to use checksums
0ee679b3e43b30a36a48319a20ae84b9f914d09bea95babf4d5e10772c2c04d1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.10

Release files / easy2d-0.5.2-py3-none-any.whl

Download URL easy2d-0.5.2-py3-none-any.whl
Size 40.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6296178299c234fe163d81c1509596df711f4ae7306cf76b8a78a70e19f21483
BLAKE2b-256 checksum
How to use checksums
d2ca9e3f771177f887abb666be455ca32986b32966e707afb0117b698a0bc6c6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.10

Security for easy2d 0.5.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page