r/pyxel • • Nov 29 '25

Hey is it possible to import a midi file in pyxel? (Only ressource I found was sketchy website)

Post image
1 Upvotes

I'm extremely new to pyxel and before I got started I wanted to check wether it was possible to import midi files into the game engine (instead of creating them from scratch). I found zero ressources online telling me this was the case, but I did find this website. I've used similar sketchy websites in the past without issues (like yt to mp3, or png to jpeg converters), but I still wanted to check so I dont download a virus if such a thing was possible (and if a "pixel" file really exists)

Thanks a lot


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 • • Feb 19 '25

Failed to load pyxres file

1 Upvotes

I know this has been asked before but none of the solutions seem to be working :(
I have to make a game using pyxel for school, and it works fine until i try and load a pyxres file. I'm on macos 14.5 and using thonny.

Heres my code, its just some basic stuff that i put to try things out :

import pyxel

class App:

def __init__(self):

pyxel.init(160,120, title ="hello world")

pyxel.load("ressource.pyxres")

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

def update(self):

if pyxel.btnp(pyxel.KEY_Q):

pyxel.quit

def draw(self):

pyxel.cls(0)

pyxel.text(55,41,"Hello world", 5)

App()

The error i get is : pyo3_runtime.PanicException: Failed to open file 'ressource.pyxres'
My pyxres file and my python file are located in the same place.

The odd thing is when i try and load an old pyxres file i'd used for a class assignment a year ago, it works fine, i can see the sprites, but then when i try and edit the file it appears blank ?? despite still appearing when i run my old code.

if anyone can help i'd really appreciate it


r/pyxel • • Jan 14 '25

.pyxres file won't load

1 Upvotes

import pyxel

class App:

def __init__(self):

pyxel.init(160, 120, title="Hello World") # window size and title

pyxel.load("mygame.pyxres") # resourcefilename.pyxres

pyxel.run(self.update, self.draw) # calls update and draw 60fps

def update(self):

if pyxel.btnp(pyxel.KEY_Q): # button press q causes quite

pyxel.quit()

def draw(self):

pyxel.cls(0) #clears the screen

pyxel.blt(0, 0, 0, 0, 8, 8)

App()

on pyxel.load("mygame.pyxres") it flags an error and says "failed to open file mygame.pyxres" but i made a .pyxres image using the editor?


r/pyxel • • Nov 02 '24

Database to store leaderboard scores

1 Upvotes

What is the best way to store data in pyxel ? SQLite DB? Just some in memory dictionary ? Save the data to a binary file ? I guess i cannot use a postgresql db as I want to package my solution as a single package, standalone.


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 • • 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 • • May 12 '24

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

Thumbnail self.html
1 Upvotes

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 • • 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 • • 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 • • 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 • • 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 • • 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 • • 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 • • 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 • • Sep 26 '23

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

Thumbnail
gallery
11 Upvotes

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 02 '22

Shoot bad things

8 Upvotes

r/pyxel • • Nov 02 '22

Shadow kinda effect with Pyxel

15 Upvotes

r/pyxel • • Dec 15 '21

Mario Bros

5 Upvotes

I had to create recently a Mario Bros using Pyxel.
This is the Github repository of the game. Remember Pyxel version 1.5.0 is needed to execute them.

https://github.com/edusombra/MARIOBROS


r/pyxel • • Oct 11 '21

Online game

1 Upvotes

is there a way i can make an online game using pyxel


r/pyxel • • Sep 14 '21

Anyone know what's going on here?

Post image
2 Upvotes

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?