Skip to main content

Physics module for the Pyxel engine.

Project description

Motor de jogos simples que utiliza física baseado em Pyxel.

Instalação

Clone este repositório e utilize flit install -s para instalar localmente. Em breve teremos suporte para pip install pytaon ;-).

Tutorial

Criamos uma simulação simples de duas caixas sujeitas à lei da gravidade.

import pytaon as on
import pyxel

WIDTH = 120
HEIGHT = 80

Criamos os objetos de jogo, junto ao espaço correspondente

sp = on.Space()
bola = sp.add_circle(5, (120, 90), color=pyxel.COLOR_RED)
chao = sp.add_aabb(0, 160, 240, 180, color=pyxel.COLOR_LIME, mass="inf")
bola.gravity = (0, 20)

Iniciamos a simulação passando as funções update e draw para o pyxel.

def update():
    sp.update(1/30)

def draw():
    pyxel.cls(pyxel.COLOR_BLACK)
    sp.draw()

pyxel.init(240, 180, fps=30)
pyxel.run(update, draw)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for pytaon, version 0.0.2b0
Filename, size File type Python version Upload date Hashes
Filename, size pytaon-0.0.2b0-py2.py3-none-any.whl (15.9 kB) File type Wheel Python version py2.py3 Upload date Hashes View
Filename, size pytaon-0.0.2b0.tar.gz (17.5 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page