Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PyRay - Python Game Development Made Simple 🎮

Python 3.8+ License: MIT Discord

PyRay is a simple and easy-to-use Python library for game development and multimedia applications. Inspired by raylib, PyRay brings the simplicity of game development to Python with an intuitive API that lets you create games in just a few lines of code.

🚀 Features

  • Simple and Intuitive - Create a window and start drawing in just 3 lines of code
  • Cross-Platform - Works on Windows, macOS, Linux, and Web (via Pyodide)
  • 2D Graphics - Shapes, sprites, text rendering, particle systems
  • 3D Graphics - Basic 3D shapes, model loading, lighting (via Open3D/PyVista)
  • Input Handling - Keyboard, mouse, gamepad support
  • Audio System - Sound effects and music playback
  • Physics - Built-in 2D physics and collision detection
  • Fast - Hardware-accelerated rendering
  • Integrations - OpenCV, Matplotlib, Jupyter, Open3D, PyVista support
  • Tools - Project generator, migration guides, extensive examples

📦 Installation

# Basic installation
pip install pyray

# With optional integrations
pip install pyray[opencv]      # Computer vision support
pip install pyray[matplotlib]  # Data visualization
pip install pyray[jupyter]     # Jupyter notebook support
pip install pyray[all]         # Everything

🎯 Quick Start

import pyray

# Create a window
pyray.init_window(800, 600, "My First PyRay Game")

# Game loop
while not pyray.window_should_close():
    # Update
    x = pyray.get_mouse_x()
    y = pyray.get_mouse_y()
    
    # Draw
    pyray.begin_drawing()
    pyray.clear_background(pyray.BLACK)
    pyray.draw_circle(x, y, 20, pyray.RED)
    pyray.draw_text("Hello PyRay!", 10, 10, 20, pyray.WHITE)
    pyray.end_drawing()

# Cleanup
pyray.close_window()

📚 Examples

Check out the examples directory for more demos:

Basic Examples:

Complete Games:

  • Snake - Classic snake game with particles
  • Tetris - Full Tetris with rotation and line clearing
  • Space Shooter - Vertical shooter with power-ups

Integrations:

🎓 Learning Resources

🤝 Contributing

We welcome contributions! Please see our Contributing Guide for details.

🗺️ Roadmap

Phase 1: MVP (Current)

  • ✅ Window management
  • ✅ Basic 2D graphics (shapes, text)
  • ✅ Input system (keyboard, mouse)
  • ✅ Sprites & images (load/draw textures)
  • ✅ Audio basics (sounds, music)

Read full roadmap and plans:

📄 License

PyRay is licensed under the MIT License. See LICENSE for details.

🌟 Support

💖 Sponsors

PyRay is an open-source project. If you'd like to support its development:


Made with ❤️ by the PyRay community

About

No description, website, or topics provided.

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages