Skip to main content

GameObject and Physics framework for Pyxel

Project description

Pyxel-Physics

日本語 | English

日本語

概要

レトロゲームエンジン**Pyxel**上で動作する軽量で、プログラミング初心者向けの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

pyxel_physics_engine-0.1.1.tar.gz (8.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyxel_physics_engine-0.1.1-py3-none-any.whl (10.2 kB view details)

Uploaded Python 3

File details

Details for the file pyxel_physics_engine-0.1.1.tar.gz.

File metadata

  • Download URL: pyxel_physics_engine-0.1.1.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

Hashes for pyxel_physics_engine-0.1.1.tar.gz
Algorithm Hash digest
SHA256 478a5186571732f1f835722f257b333c3b52775fcee7b9564355ee5888fd5602
MD5 5172489528a0dc736af5e631e769511d
BLAKE2b-256 5d6fc048c6a418b2843a29c2e87c844a59fa588d18b44fe85827ac0b51418d9d

See more details on using hashes here.

File details

Details for the file pyxel_physics_engine-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for pyxel_physics_engine-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8c93d3531be49ca1e9890193474390447b0054f525406566f19e0e999fd162a9
MD5 a562af8f3b0379b0a70ef51397e9dcaa
BLAKE2b-256 988708b54afc993963f2a43d4dd284b1b5e6c429c296724ea0a54c299ed99d64

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page