GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - Mahi/EzPyGame: An easier way to use pygame

BranchesTags
Open more actions menu

Latest commit

 

History

30 Commits
30 Commits

Folders and files

NameName
Last commit message
Last commit date
docs
docs
 
 
ezpygame
ezpygame
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
requirements.txt
requirements.txt
 
 

Repository files navigation

EzPyGame

EzPyGame aims to make the usage of pygame easier and more pythonic than before. It implements easy scene management tools and an application class for initializing pygame and running scenes easily.

Installation

pip install ezpygame

Quick start

Create scenes by subclassing ezpygame.Scene and overriding any of the following methods:

  • handle_event(self, event)
  • draw(self, screen)
  • update(self, dt)
  • on_enter(self, previous_scene)
  • on_exit(self, next_scene)

Now create an ezpygame.Application instance and start the execution from any scene:

app = ezpygame.Application(
    title='My First EzPyGame Application!',
    resolution=(1280, 720),
    update_rate=60,
)
main_menu = MenuScene()
app.run(main_menu)

Scenes can be switched by using the Application.change_scene(scene) method:

class Game(Scene):
    ...

    def on_enter(self, previous_scene):
        self.previous_scene = previous_scene

    def update(self, dt):
        self.player.move(dt)
        if self.player.died():
            self.application.change_scene(self.previous_scene)

Reference documentation

With more in-depth guide and examples: https://ezpygame.readthedocs.io/

About

An easier way to use pygame

Topics

game-developmentgamedevpygamepygame-librarypythonpython3python3-library

Resources

Readme
MIT license
Activity

Stars

72 stars

Watchers

3 watching

Forks

7 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.