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: 1.0.2beta
New
1.0.2alpha: passed the test on Windows 10 and Ubuntu.
1.0.2beta: deleted opengame.utils.builtin.builtin module
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))
rect = text.get_rect()
rect.x, rect.y = pg.mouse.get_pos()
screen.blit(text, rect)
for event in pg.event.get():
if event == pg.QUIT:
pg.quit()
sys.exit()
pg.display.update()
Really easy?
Although using pyglet and opengame is similar, opengame has other reason why you should use it.
Note: In large projects, you should still use other packages because
opengamedesigned for small projects.
The Advantages
- Simple API, callback system;
- A perfect resource library;
- Great encapsulation, more functions;
- Lots of humanity design.
The Inferiority
- Instability;
- Not applicable to large projects.
Install
Use pip install it:
pip install -U opengame
Use git:
git clone https://github.com/stripepython/opengame/
cd opengame
pip install -r requirements.txt
python setup.py install
Where can I see OpenGame?
- PYPI: https://pypi.org/project/opengame/
- Github: https://github.com/stripepython/opengame/
- Document: https://stripepython.github.io/opengame/
- CSDN: https://blog.csdn.net/weixin_38805653?type=blog
Document
See https://github.com/stripepython/opengame/ or /docs/index.md
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file opengame-1.0.2b0.tar.gz.
File metadata
- Download URL: opengame-1.0.2b0.tar.gz
- Upload date:
- Size: 12.2 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.5.0.1 requests/2.28.1 requests-toolbelt/0.9.1 tqdm/4.64.0 CPython/3.8.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
013b30640854dd6070985b391903a422930ce265d3297b680b6c0c687e155470
|
|
| MD5 |
3394f1c4e941d412d6a35ab39cd2d8bf
|
|
| BLAKE2b-256 |
a6c9058953f495a806dfb58a9c6f6a17c39094e80fb34ad5692f1597747f8572
|
File details
Details for the file opengame-1.0.2b0-py3-none-any.whl.
File metadata
- Download URL: opengame-1.0.2b0-py3-none-any.whl
- Upload date:
- Size: 12.2 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.5.0.1 requests/2.28.1 requests-toolbelt/0.9.1 tqdm/4.64.0 CPython/3.8.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5cc4bf14633538e3b5c6533f6a5b4a4cf7e56d7b6c5fb5ab70ab852cd2a4b2fd
|
|
| MD5 |
432111cf703e224f4a528fc0db9e6853
|
|
| BLAKE2b-256 |
59a060f0b634d76ec79eb08688c74bcb389c18597d4d1ef68fa47cafaf52b695
|