No project description provided
Project description
OpenGame is a Python3 module that can help you build a game faster.
Document is writing, this is the dev version.
Version: 0.2.1beta
Theory
OpenGame built on pygame2. Many features of pygame are retained.
Therefore, it has good compatibility with pygame.
Why do you use OpenGame?
Let's see an example, we'll show a label "Hello World" on the screen. And let it follow the mouse.
If we use opengame
, we should:
import opengame as og
win = og.Window('Demo', (800, 600))
text = og.Label('Hello World')
text.pack()
@win.when_draw
def draw():
text.pos = win.mouse.pos
win.show()
If we use pygame
, we should:
import sys
import pygame as pg
pg.init()
pg.font.init()
screen = pg.display.set_mode((800, 600))
pg.display.set_caption('Demo')
font = pg.font.Font(None, 26)
while True:
screen.fill((255, 255, 255))
text = font.render('Hello World', True, (0, 0, 0))
screen.blit(text, 400 - text.get_rect().width // 2, 300 - text.get_rect().height // 2)
for event in pg.event.get():
if event == pg.QUIT:
pg.quit()
sys.exit()
Really easy?
Although using pyglet
and opengame
is similar, yet opengame
has other reason why you use it.
Note: In large projects, you should still use other packages because OpenGame designed for small projects.
The Advantages
- Simple API, callback system;
- A perfect resource library;
- Great encapsulation, more functions;
- Lots of humanity design.
The Inferiority
- Instability(Only passed the test on Windows 10);
- Not applicable to large projects.
Install
Use pip
install it:
pip install -U opengame
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for opengame-0.2.1b0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 59f5ecaa4e3823989c9db8a8894fdb69f3f4fe26dba740bc6710a4c8d9174b06 |
|
MD5 | 8a15c1e98af7c65f0b8c4e42f061c2c4 |
|
BLAKE2b-256 | f818f3e12a48c50816a8839ec8618557005bb1bef61897d9cef11cfe09663cde |