GameObject and Physics framework for Pyxel
Project description
Pyxel-Physics
日本語
概要
レトロゲームエンジン****上で動作する軽量で、プログラミング初心者向けの2D物理演算フレームワークです.
特徴
- 知識がなくても使いやすい
- 直感的な仕組み。
App,Worldを作ってaddするだけで、すぐにゲームが作ることができます! - 豊富なデモと日本語によるドキュメント (予定)
- 直感的な仕組み。
インストール方法 & チュートリアル
pip install pyxel-physics-engine
import pyxphys
import pyxel
class Ball(pyxphys.GameObject):
color : int = 6 # ボールの色
radius : int = 10 # ボールの半径
def __init__(self):
super().__init__(x=100, y=20)
self.name = "ball"
self.vx = 0
self.vy = -4
self.add_collider(pyxphys.CircleCollider(self.radius))
def update(self):
if self.y > 190:
self.vy *= -0.9
self.y = 190
def draw(self):
pyxel.circ(self.x, self.y, self.radius, self.color)
# 初期設定
app = pyxphys.App(200,200) # アプリ本体
world = pyxphys.World(gravity = 0.9) # アプリの中における世界
app.add_world(world) # ゲーム本体に、世界を追加
world.add_object(Ball()) # "world"という世界にBallオブジェクトを追加
app.run() # アプリを実行
English
This framework enables you to use a physic object with a retro game-engine Pyxel.
Project details
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 pyxel_physics_engine-0.1.2.tar.gz.
File metadata
- Download URL: pyxel_physics_engine-0.1.2.tar.gz
- Upload date:
- Size: 8.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
444ed82aa84ab5cf90d80904dc2f267e4ce86839fd60986e8b3cbdc430e85b38
|
|
| MD5 |
52eb647d20914b046e68d2fc774c0ee1
|
|
| BLAKE2b-256 |
170968075651b5dbf822a220ccb59891fdeac95a14fed6a58cd13e4e80547d2e
|
File details
Details for the file pyxel_physics_engine-0.1.2-py3-none-any.whl.
File metadata
- Download URL: pyxel_physics_engine-0.1.2-py3-none-any.whl
- Upload date:
- Size: 10.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6210cfa39e69c1e7128b59942ca8be0fcb4fb448402d4a66188761f2534d1d01
|
|
| MD5 |
b001a7dfd0a87140c5f8506dd4b2ea01
|
|
| BLAKE2b-256 |
acabb3dc6570a0e7d0a531337559aa28a95e027863a3b5b67418b4ebe3991b5e
|