|
app.py
import pyxel
pyxel.init(255, 112, title="bataille", fps=60, quit_key=pyxel.KEY_Q)
def bouge_perso():
global perso_x, perso_y
if pyxel.btn(pyxel.KEY_RIGHT):
if (perso_x < 120) :
perso_x = perso_x + 1
if pyxel.btn(pyxel.KEY_LEFT):
if (perso_x > 0) :
perso_x = perso_x - 1
if pyxel.btn(pyxel.KEY_DOWN):
if (perso_y < 120) :
perso_y = perso_y + 1
if pyxel.btn(pyxel.KEY_UP):
if (perso_y > 0) :
perso_y = perso_y - 1
def affiche_perso():
pyxel.rect(perso_x, perso_y, 8, 8, 1)
def update():
if pyxel.btnp(pyxel.KEY_Q):
pyxel.quit()
def draw():
pyxel.cls(1)
pyxel.rect(10, 10, 16, 16, 11)
affiche_perso()
perso_x = 60
perso_y = 60
pyxel.run(update, draw)
Description
Documentation
PACKAGES
If your project uses packages, list them bellow (names separated by commas). Packages that can be added are only packages built in Pyodide. Example: numpy,pandas Layout
Packages
If your project uses packages, list them bellow (names separated by commas). Packages that can be added are only packages built in Pyodide.
Example: numpy,pandas File to execute with the public link
PYXEL DOCUMENTATION
|