r/pyxel • • May 18 '25

recover old data

2 Upvotes

Hello one year ago i was using pyxelstudio through my high school website Capytale, now I'm a student so i lost my access to capytale. I was coding a video game and i have an html save file on my computer, when i'm opening it, for a second it opens correctly but just after that there is a problem.

Please do you have a solution ):


r/pyxel • • Dec 26 '20

I cannot understand the set function in the image class

4 Upvotes

I read README in pyxel and I found this function. But I cannot get it. What does that mean?


r/pyxel • • Jul 04 '20

Having issues with pyxelpackager on macos

1 Upvotes

Hey y'all,

Relatively new to Pyxel, and I was testing out the packager to create a standalone executable.

I'm trying to package a single python file, called Arise.py

I installed PyInstaller with pip in my pyxel environment, then ran pyxelpackager Arise.py and it created the dist folder as expected, containing an exec file Arise and a directory Arise.app.

Then, I sent the dist folder to myself and tried running it on two other macbooks. Each time, clicking on the .app directory seemed to launch the game for an instant, then it would immediately close.

If I clicked on the exec file, I got the following error in the Terminal:


Traceback (most recent call last):
  File "site-packages/PyInstaller/loader/pyiboot01_bootstrap.py", line 151, in __init__
  File "ctypes/__init__.py", line 364, in __init__
OSError: dlopen(/var/folders/48/647rz0bd5ys2332kxpbkh4dh0000gn/T/_MEIw3a9BQ/pyxel/core/bin/macos/libpyxelcore.dylib, 6): Library not loaded: /usr/local/opt/sdl2/lib/libSDL2-2.0.0.dylib
  Referenced from: /private/var/folders/48/647rz0bd5ys2332kxpbkh4dh0000gn/T/_MEIw3a9BQ/pyxel/core/bin/macos/libpyxelcore.dylib
  Reason: image not found
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "Arise.py", line 1, in <module>
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "/Users/davidmays/.venvs/ArisePyxel_env/lib/python3.7/site-packages/PyInstaller/loader/pyimod03_importers.py", line 623, in exec_module
  File "site-packages/pyxel/__init__.py", line 10, in <module>
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "/Users/davidmays/.venvs/ArisePyxel_env/lib/python3.7/site-packages/PyInstaller/loader/pyimod03_importers.py", line 623, in exec_module
  File "site-packages/pyxel/core/__init__.py", line 43, in <module>
  File "site-packages/pyxel/core/__init__.py", line 40, in _load_library
  File "ctypes/__init__.py", line 442, in LoadLibrary
  File "site-packages/PyInstaller/loader/pyiboot01_bootstrap.py", line 153, in __init__
__main__.PyInstallerImportError: Failed to load dynlib/dll '/var/folders/48/647rz0bd5ys2332kxpbkh4dh0000gn/T/_MEIw3a9BQ/pyxel/core/bin/macos/libpyxelcore.dylib'. Most probably this dynlib/dll was not found when the application was frozen.
[40631] Failed to execute script Arise

I checked the environment from which I ran pyxelpackager, and I found pyxel/core/bin/macos/libpyxelcore.dylib, so I'm not sure why the image was not found in the final package on my other machines.

If anyone has advice on where to look next, would be greatly appreciated!


r/pyxel • • Apr 25 '20

New version of Pyxel, a retro game engine for Python, released

28 Upvotes

r/pyxel • • Jul 13 '20

"Road Rush" Pyxel Game

6 Upvotes

r/pyxel • • May 28 '20

What's everyone working on?

5 Upvotes

I'm currently working on my first game. I'm slowly getting there and learning a lot


r/pyxel • • Oct 30 '20

Discord Server

1 Upvotes

I would like to join the Discord server, can anyone comment the invite link here please? Thank you very much.


r/pyxel • • Jun 07 '20

How to use a USB game controller?

3 Upvotes

Have any of you ever used a USB game controller with pyxel?


r/pyxel • • Mar 26 '20

Troubleshooting Pyxelpackager

5 Upvotes

I am actively creating a Zelda-like game (very original, I know), and I'm doing small releases of each version so that others can see how the source code changes over time.

I'm also releasing binaries for Linux/Mac/Windows with every release, and so I got some experience with the Pyxelpackager. I documented all the things I ran into when compiling on the three platforms, so hopefully this helps to steer others that are similarly stuck.

Troubleshooting Pyxelpackager

Dungeon DOS v0.0.1


r/pyxel • • Jul 17 '20

Pyxel Rain Game

11 Upvotes

r/pyxel • • Jul 08 '20

how do i use pyxel in visual studio?

2 Upvotes

i think it works but im not sure..


r/pyxel • • Jun 12 '24

How to make a menu?

2 Upvotes

I'm making a clicker and I need to make the store as a menu, how do I do this?


r/pyxel • • Jan 02 '24

Import pyxel

1 Upvotes

I have used the instructions to install pyxel with pip3. However I can only get pyxel to work inside of a virtual environment using pycharm. But if I where to use the any example or simple code using idle import pyxel doesn't work at all.

Thanks for any help.


r/pyxel • • Jun 15 '24

Tilemap

1 Upvotes

Hello, is there a way to "update" a single tile using tilemap? I am doing something that when a sprite hits a tile, the tile should change into another tile. I tried to implement an update function that draws over that specific tile but it doesn't work.


r/pyxel • • Feb 12 '24

Issue with loading an "old" pyxres file

1 Upvotes

I have my game on PYZO and the file of the code and the pyxres files are on the same file on my computer.

But when I load any of the pyxres (I have 4 because I have 4 games in one) this error shows up :

An old Pyxel resource file 'res_D.pyxres' is loaded. Please re-save it with the latest Pyxel.

I edit the pyxres in pyxel studio online so it's the latest Pyxel no ? Else how could I "re-save" it for it to works ?

So why it happens and how do I fix it please ?


r/pyxel • • Mar 14 '24

Help from those who know Russian

1 Upvotes

Hello, I have such a problem, I tried to study this library using a video from Russian-language YouTube and did not understand anything. Are there people who can help me study this library?

Здравствуйте, у меня такая проблема, я пытался изучить эту библиотеку по видео с русскоязычного YouTube и ничего не понял. Есть ли люди, которые могут помочь мне изучить эту библиотеку?


r/pyxel • • Apr 15 '24

Gloomhaven in pyxel

3 Upvotes

Has anyone played the boardgame Gloomhaven?
I am implementing a version of it in python with pyxel, currently stripped of its legacy parts.
I use ecs and development is really easy!!
What do you think? Would anyone be interested or would like to help?


r/pyxel • • Sep 26 '23

Just released our game Starry Serenade on itch.io. Links in comment.

Thumbnail
gallery
11 Upvotes

r/pyxel • • Apr 06 '24

Graphic arts

1 Upvotes

Tell me how to make it so that when you go to the right, the character looks to the right, and when the character goes to the left, he looks to the left


r/pyxel • • Sep 14 '23

Exporting Tileset Only Exports Blank Tile

2 Upvotes

Really dumb question, I apologize.

Exporting sounds like it would be easy, and videos just show people pressing export.

I created a Tileset and I wanted to export it as a file to put into unity to start learning some programming.

But every time I export the Tileset, it exports as a blank single cell. Not the whole sheet.

I can do it as an image and it does the whole image, but it ends up being fuzzy in unity.

What silly thing am I missing in this?...


r/pyxel • • Nov 23 '23

help pls

1 Upvotes

Whenever I print the character of the game I'm trying to develope (which is a portion of my .pyxres sprite), I just have a black background filling the rectangle (because when printing the sprite what you are doing is printing a rectangular portion of that file, I think), and when moving the character around the tilemap, there is also the black rectangle that is printed. Anyone knows if there is some function to turn the rectangle transparent or something like that? Thanks.


r/pyxel • • Oct 19 '23

I need help for a program for my Pong game

1 Upvotes

I am french and here i am trying to recreate a pong game as a class project, for the moment i got the base game where the ball have collision and everything, i am trying to add some power up so that when the ball touches a power up then the speed of the ball changes but here it doesnt work, i will later too try to add some kind of ai where i could play alone and i will too add a menu.
Here is my code so please feel free to use it or to help me.

import pyxel

import random

class Balle:

def __init__(self):

self.x=pyxel.width/2

self.y=pyxel.height/2

self.width=6

self.height=6

self.angle=pyxel.rndi(-70,70)+180*pyxel.rndi(0,1)

self.vitesse=7

self.game_over=False

self.score_1 = 0

self.score_2 = 0

def update(self):

if self.game_over==False:

self.x=self.x+self.vitesse*pyxel.cos(self.angle)

self.y=self.y-self.vitesse*pyxel.sin(self.angle)

if self.y - self.width/2<=0 or pyxel.height <= self.y + self.width/2>=0 :

self.angle= -self.angle

if self.x - self.width/2 < 0:

self.score_2 +=1

self.x=pyxel.width/2

self.y=pyxel.height/2

if self.x + self.width/2 > pyxel.width:

self.score_1 += 1

self.x=pyxel.width/2

self.y=pyxel.height/2

def draw(self):

pyxel.circ(self.x,self.y,self.width/2,13)

pyxel.text(60,3,str(self.score_1),7)

pyxel.text(100,3,str(self.score_2),7)

class PowerUp:

def __init__(self):

self.x= random.randint(30, 120)

self.y= random.randint(20, 90)

self.width=8

self.height=10

def draw(self):

pyxel.rect(self.x,self.y,self.width,self.height, random.randint(1,15))

def collision(self,balle):

if balle.x - balle.width/2 <= self.x + self.width \

and balle.x + balle.width/2 >= self.x \

and balle.y + balle.width/2 >= self.y \

and balle.y - balle.width/2 <= self.y+self.height :

self.boule.vitesse *= 1.5

class Joueur1:

def __init__(self):

self.x=20

self.y=pyxel.height/2

self.width=10

self.height=30

self.vitesse=6

def update(self):

if pyxel.btn(pyxel.KEY_Z) and self.y > 0:

self.y=self.y-self.vitesse

elif pyxel.btn(pyxel.KEY_S) and self.y < 90 :

self.y=self.y+self.vitesse

def draw(self):

pyxel.rect(self.x,self.y,self.width,self.height,5)

def colision(self,balle):

if balle.x - balle.width/2 <= self.x + self.width \

and balle.x + balle.width/2 >= self.x \

and balle.y + balle.width/2 >= self.y \

and balle.y - balle.width/2 <= self.y+self.height :

balle.angle = 180-balle.angle

class Joueur2:

def __init__(self):

self.x=130

self.y=pyxel.height/2

self.width=10

self.height=30

self.vitesse=6

def update(self):

if pyxel.btn(pyxel.KEY_UP) and self.y > 0:

self.y=self.y-self.vitesse

elif pyxel.btn(pyxel.KEY_DOWN) and self.y < 90 :

self.y=self.y+self.vitesse

def draw(self):

pyxel.rect(self.x,self.y,self.width,self.height,10)

def colision(self,balle):

if balle.x - balle.width/2 <= self.x + self.width \

and balle.x + balle.width/2 >= self.x \

and balle.y + balle.width/2 >= self.y \

and balle.y - balle.width/2 <= self.y+self.height :

balle.angle = 180-balle.angle

class Game:

def __init__(self):

pyxel.init(160,120,fps=12)

self.player1 = Joueur1()

self.player2 = Joueur2()

self.boule = Balle()

self.powerawp = PowerUp()

pyxel.run(self.update, self.draw)

def update(self):

self.powerawp.update()

self.player1.update()

self.player2.update()

self.boule.update()

self.player1.colision(self.boule)

self.player2.colision(self.boule)

def draw(self):

pyxel.cls(0)

self.powerawp.draw()

pyxel.line(pyxel.width // 2, 0, pyxel.width // 2, pyxel.height, 7)

self.player1.draw()

self.player2.draw()

self.boule.draw()

Game()


r/pyxel • • Nov 05 '23

help

1 Upvotes

i don't know why when i try to use the pyxeleditor it tells me that the term is not recognized as the name of a cmdlet, function, script file, or operable program. What can i do to make it works?


r/pyxel • • May 12 '24

How do I fix "SyntaxError: '(' was never closed"?

Thumbnail self.html
1 Upvotes