r/pygame • u/Sea-Dragonfruit-8790 • Sep 16 '26
r/pygame • u/Difficult_Ad_7922 • Sep 17 '26
How to play mp3 file with Pydroid3
I want to play my mp3 files with Python. This is no problem on Windows or Linux but does not work on Android with Pydroid3.
This is my code player.py:
import os
import time
import pygame
from pygame import mixer
DIR = "./music/"
os.chdir(DIR)
pygame.init()
mixer.init()
mixer.music.load("01 - Marie.mp3")
mixer.music.play()
while mixer.music.get_busy(): # wait for music to finish playing
time.sleep(1)Running this in Pydroid3 gives:
/sdcard $ python3 player.py
pygame 2.6.1 (SDL 2.30.8, Python 3.12.9)
Hello from the pygame community. https://www.pygame.org/contribute.html
Traceback (most recent call last):
File "storage/emulated/0/player2.py", line 8, in <module>
mixer.init()
pygame.error: Application didn't initialize properly, did you include SDL_main.h in the file containing your main() function?I also tried to play with vlc player but this also does not work on Android
I am looking forward for any suggestions
r/pygame • u/GeneStoneGames • Sep 16 '26
Shipped a $2.99 Python greenhouse genetics breeding game (GeneBloom)
hey — eli, solo. shipped GeneBloom: cozy greenhouse flower genetics in Python. breed plants, chase mutations, sell to quirky customers. pixel art, win/mac/linux, $2.99 on steam.
https://store.steampowered.com/app/4696820/GeneBloom/
not a link dump — happy to talk stack / pygame-family packaging / breeding loop. if someone wants a key for feedback ask in replies (no keys in post).
r/pygame • u/mefistofeles57 • Sep 15 '26
Built a pseudo-3D arcade racer from scratch in Pygame — no 3D engine, just projected polygons
I've been building a pseudo-3D racing game engine from scratch in Python/Pygame, inspired by arcade racers from the late 80s/early 90s. No OpenGL, no 3D library — just world points projected onto 2D polygons and sprites.
The renderer transforms world-space points relative to the camera, rotates them by camera pitch, and applies a non-linear depth compression to avoid excessive perspective distortion at long distances. Road, traffic, and roadside scenery all share the same projection so depth feels consistent.
It's fully playable start to finish: traffic with collision detection, continuous collision checks at high speed, shadows, animated sprite effects, HUD, race timer, data-driven track generation, 60 FPS. Cornering depends on both speed and where you're positioned on the road, so there isn't always one "correct" line through a corner.
I taught myself pixel art from scratch for this project — most of the sprites are my own at this point, just a few placeholders left to replace.
Currently working on scenery variety and enemy car spawn logic.
Repo: https://github.com/mefistofeles57/pseudo3d
Playable build: https://mefistofeles57.itch.io/cool-racing
Video: https://www.youtube.com/watch?v=BSslZnQfmh0
Happy to go into detail on the projection math or any of the systems if anyone's curious.
r/pygame • u/jpabrao_l • Sep 16 '26
Bunny Farm Update: After almost a week, I finally managed to finish one of the game's minigames!
galleryHi! Since Friday, I’d been thinking about what to do with a minigame from *Bunny Farm*—an asteroid game set in a kitchen that felt totally random. Then, I noticed an oven in the background and got an idea: I swapped the asteroids for cookies and added a background that actually made sense for the game, while also making it look cuter.
r/pygame • u/Difficult_Ad_7922 • Sep 15 '26
How to play mp3 file with Pydroid3
I want to play my mp3 files with Python. This is no problem on Windows or Linux but does not work on Android with Pydroid3.
This is my code player.py:
import os
import time
import pygame
from pygame import mixer
DIR = "./music/"
os.chdir(DIR)
pygame.init()
mixer.init()
mixer.music.load("01 - Marie.mp3")
mixer.music.play()
while mixer.music.get_busy(): # wait for music to finish playing
time.sleep(1)Running this in Pydroid3 gives:
/sdcard $ python3 player.py
pygame 2.6.1 (SDL 2.30.8, Python 3.12.9)
Hello from the pygame community. https://www.pygame.org/contribute.html
Traceback (most recent call last):
File "storage/emulated/0/player2.py", line 8, in <module>
mixer.init()
pygame.error: Application didn't initialize properly, did you include SDL_main.h in the file containing your main() function?I also tried to play with vlc player but this also does not work on Android
I am looking forward for any suggestions
r/pygame • u/Electronic_Place8767 • Sep 15 '26
How to increase game resolution without changing window size?
galleryIve been at this project for 2 months now and its the first project where i spent my money hiring an artist, issue is the dimensions of the game window is 800x600 and i commissioned for very DETAILED art, so when the ships were shown in game they looked very blurry since its smoothed out to not look pixelly when scaled down. Can i still show the artist’s work by increasing the resolution without changing the game’s window size?
r/pygame • u/Crazy_Spend_4851 • Sep 14 '26
Creating A JRPG In Python...thoughts?
youtu.beHi guys,
Check out the lates on my pygame JRPG if you get chance 😊 sprites are reworked from Octopath traveller! I'm hoping to do my own soon. I'm developing a sprite editor that I'm hoping to ship out for public use so stay tuned for that! Any thoughts on ways you'd improve this, I'm not happy with the turn order bar, I'm thinking of how I could make it more compact while still containing the necessary detail!
Thanks again guys 😊
r/pygame • u/EstimateNo9755 • Sep 14 '26
I just made my first game but its slightly ai assisted with Gemini 3.g flash
I dont know it seems basic compared to the other first games I've seen here
r/pygame • u/Scared_Confection980 • Sep 13 '26
My frist pygame proyect: Mecha-Ryu
It was so complicated but here it is: https://github.com/CodeBreaker-cmd/Mecha-Ryu
Or itch if you want... https://codebreaker-cmd.itch.io/mecha-ryu
I hope that you enjoy and tell me about some bugs if you want
r/pygame • u/Scared_Confection980 • Sep 13 '26
My first game on pygame at end!!
Here is my creation : https://github.com/CodeBreaker-cmd/Mecha-Ryu
If you want, you can make a review or tell me about some bugs
r/pygame • u/Puzzleheaded_Card625 • Sep 11 '26
MMORPG WITH PYGAME IS REAL?
Yes it is!
Im working on a MMORPG top-down, tile-based, pixel art. The game is inspired in Tibia, World of Warcraft, League of legends, and the differential, "and why LoL is between if is not a MMORPG?"
because in my project, we have a pvp instantiated (BG) that is MOBA style, the character starts as level 1, and his progress do not interfere in the game out of BG. The game have Quests, with miltiple types of objectives, trade between players, vendors, skill levels, habilities, talent trees, three classes(warrior, mage and archer) craft items, and go on. My big challenge is create the pixel art for characters, NPCs, enemies etc. I bought the asset of Cainos, from itch.io, because i love it, then i need to crete characters that match with the world because his asset dont include characters. Somebody interestes to be the gamedesign of this project? If somebody is interested to test the game, invite me in discord: juuguerino
r/pygame • u/jpabrao_l • Sep 10 '26
Bunny Farm update: I just finished making the menu and modified a few things.
galleryHi! In this update, I finally finished the game menu; it’s simple, but I think it conveys a sense of innocence. I also added an item to the game—a cassette tape—which will have a function later on. Plus, I migrated from pygame to pygame-CE; I’m not sure if it makes a big difference, but it was suggested that I make the switch. Thanks for all the feedback!
r/pygame • u/Alert_Nectarine6631 • Sep 10 '26
Water interactions(WIP)
I've been working on a better water movement system for the player, I've also implemented water splash particles, as well as that the enemy hit particles interact with water and float to the surface.
r/pygame • u/Due_Engineer_7647 • Sep 10 '26
Nevu-UI MultiBackend Game UI framework has been updated to 0.8.5!
There are a short summary of Nevu-UI 0.8.3 - 0.8.5 versions:
Added Canvas - universal tool for drawing primitives on Widgets
Added FlexLayout - adaptive layout, unlike other layouts it dont resizes its items
Fixed a ton of bugs with layout positioning
Added text selection in Input, also added support of CTRL + C/V/X
Added 2 new window properties - gui_hovered and keyboard_available
Added Callbacks instead of NevuEvent
Refactored Style
Added 10+ built in colorthemes
Improved Checkbox API
Improved overall code quality
Improved Pygame backend quality
Current showcase is running on Pygame backend
Full Changelog can be found there:
https://github.com/GolemBebrov/nevu-ui/releases
Here are the code from the video:
import random
import pygame
import nevu_ui as ui
from nevu_ui.components._typehints import nevu_object_globals
from nevu_ui.core.size import vh, vw
from nevu_ui.presentation.animations import Vector2Animation
pygame.init()
VERSION = "0.8.5"
STATUS = "post3"
FONT_NAME = "font.ttf"
def select_layout(layout):
main_menu.layout = layout
def create_character_select():
checkbox_group = ui.CheckBoxGroup(single_selection=True)
selected = "nit"
def create_panel(text: str, id: str, chk_group: ui.CheckBoxGroup, bg_image = "gladius.png"):
time_offset = random.random() / 5
animations = ui.animations.AnimationManager()
animations.transition_time = 0.001
animations.add_start_animation(ui.AnimationType.Position, Vector2Animation((0, 0), (0, 0), time_offset))
animations.add_continuous_animation(ui.AnimationType.Position, Vector2Animation((0, 3), (0, -4), 0.1))
return ui.Panel(
size = (10%vw, 10%vh),
animation_manager = animations,
slot = ui.StackColumn(
content = [
ui.Label(text, subtheme_role = ui.SubThemeRole.PRIMARY),
ui.RectCheckBox(50, group = chk_group, id = id, style = main_style_clickable(br=15, bg_image = bg_image), toggled_rect_scale=1, toggled_rect_opacity=80)
]
)
)
def on_checkbox_toggle(checkbox: ui.RectCheckBox | None):
nonlocal selected
if not checkbox:
role_label.text = "Not selected"
return
id = checkbox.id
selected = id
id_to_text = {
"wrr": "Warrior",
"arc": "Archer",
"spr": "Spirit",
"mge": "Mage",
"nit": "Nitwit"
}
role_label.text = id_to_text[id]
checkbox_group.on_single_toggled = on_checkbox_toggle
role_label = ui.Label(
"Nitwit", single_instance=True, draw_content=False, draw_borders=False,
font_role=ui.PairColorRole.INVERSE_SURFACE, style = main_style(font_size=30, align_x = ui.Align.LEFT)
)
with nevu_object_globals.modify_temp(size = (8%vw, 4%vh)):
role_select_layout = ui.FlexLayout(
create_panel("Warrior", "wrr", checkbox_group, "gladius.png"),
create_panel("Mage", "mge", checkbox_group, "wizard-staff.png"),
create_panel("Archer", "arc", checkbox_group, "arrow-cluster.png"),
create_panel("Spirit", "spr", checkbox_group, "spectre.png"),
create_panel("Nitwit", "nit", checkbox_group, "oat.png"),
justify_content=ui.FlexJustify.SpaceAround,
gap=30
)
layout = ui.ScrollableColumn([
(ui.Align.LEFT,
ui.FlexLayout(
ui.Button(lambda: select_layout(create_start_layout()), "BACK", style = main_style_clickable(subtheme_role = ui.SubThemeRole.ERROR)),
ui.Label("Character creation"), direction = ui.FlexDirection.Column
)
),
ui.FlexLayout(
ui.Label("Name:"),
ui.Input(placeholder="Enter your name...", size = (17%vw, 5%vh), style = main_style_clickable)
),
ui.FlexLayout(ui.Label("Role:"), role_label, single_instance = True),
role_select_layout,
ui.FlexLayout(
ui.Label("Base Mana"),
ui.Slider(current = 50, start=10, style = main_style_clickable)
),
ui.FlexLayout(
ui.Label("Difficulty"),
ui.Slider(current = 2, end = 5, start = 1, style = main_style_clickable)
)],
size = ui.fill_all,
basic_alignment=ui.Align.CENTER
)
return layout
def create_start_layout():
def on_switch_change(switch, state):
global main_style, main_style_clickable
if state:
theme = ui.ColorThemeLibrary.material3_light
else:
theme = ui.ColorThemeLibrary.material3_dark
main_menu.apply_style_patch_to_layout(colortheme=theme)
main_style = main_style(colortheme=theme)
main_style_clickable = main_style_clickable(colortheme=theme)
nevu_object_globals.modify(style = main_style)
start_style = main_style_clickable(font_size = 40, subtheme_role=ui.SubThemeRole.PRIMARY, br = 999)
canvas = (ui.Canvas()
.draw_rect((50, 0), (110, 10), style = ui.Style(gradient = ui.Gradient([ui.Color.Red, ui.Color.Green])))
.draw_rect((0, 0), (50, 50), style = ui.Style(bg_image="gladius.png", br=5), id = "Zov")
.draw_rect((0, 50), (250, 10))
)
with nevu_object_globals.modify_temp(size = (15%vw, 6%vh), style = start_style):
start_layout = ui.ScrollableColumn(
[
ui.FlexLayout(ui.Label("Nevu-UI", canvas = canvas, draw_borders=False, draw_content=False), ui.Label(f"v{VERSION} {STATUS}", draw_borders=False, draw_content=False), direction=ui.FlexDirection.Row, gap=0),
ui.EmptyWidget((0, 5%vh)),
ui.FlexLayout(
ui.Button(lambda: select_layout(create_character_select()), "Play", throw_errors=True, invert_on_click=True),
ui.Button(exit, "Exit"),
ui.Switch(False, size=(3%vw, 3%vh), style=main_style(br=999), subtheme_role=ui.SubThemeRole.TERTIARY, on_switch_change=on_switch_change),
direction=ui.FlexDirection.Column, gap = 40, wrap = False
),
],
size=ui.fill_all, basic_alignment=ui.Align.CENTER, spacing=120)
return start_layout
if __name__ == "__main__":
display = pygame.display.set_mode((1920, 1080))
font = pygame.Font(size = 40)
hover_text = font.render("Hovered!", True, ui.Color.Red)
window = ui.InitializedWindow.from_pygame(display = display, title = "NvGame", resizable = True, base_fps = 999)
main_style = ui.Style(border_radius = 12, border_width = 0, font_name = FONT_NAME, colortheme=ui.ColorThemeLibrary.material3_dark)
main_style_clickable = main_style(border_width = 2, subtheme_role=ui.SubThemeRole.TERTIARY)
button_size = (10%vw, 4%vh)
nevu_object_globals.modify(size = button_size, style = main_style)
main_menu = ui.Menu(window, (50%vw, 100%vh), main_style)
main_menu.layout = create_start_layout()
while True:
window.begin_frame()
window.clear(ui.Color.Black)
window.update()
if window.keyboard_available:
if ui.keyboard.is_down(ui.Keys.D):
coords = main_menu.coordinates
main_menu.set_coordinates(coords[0] + 500 * ui.time.dt, coords[1])
if ui.keyboard.is_down(ui.Keys.A):
coords = main_menu.coordinates
main_menu.set_coordinates(coords[0] - 500 * ui.time.dt, coords[1])
if ui.keyboard.is_down(ui.Keys.Left):
main_menu.resize((main_menu.current_size.x - 400 * ui.time.dt, main_menu.current_size.y))
if ui.keyboard.is_down(ui.Keys.Right):
main_menu.resize((main_menu.current_size.x + 400 * ui.time.dt, main_menu.current_size.y))
if window.gui_hovered:
coords_text = font.render(f"{main_menu.coordinates.x:.2f}", True, ui.Color.Red)
fps_text = font.render(f"{ui.time.float_fps:.2f} fps", True, ui.Color.Red)
x_coord = main_menu.current_size.x + main_menu.coordinates.x
display.blit(hover_text, (x_coord, 120))
display.blit(coords_text, (x_coord, 200))
display.blit(fps_text, (x_coord, 280))
if not window.keyboard_available:
keyboard_text = font.render("Keyboard focus have been captured.", True, ui.Color.Red)
display.blit(keyboard_text, (x_coord, 360))
main_menu.update()
main_menu.draw()
window.end_frame()
r/pygame
•
u/Raiding_Duck
•
Sep 10 '26
My first Pygame project!
Hey everyone!
I’m currently working on my very first Pygame project (with a bunch of help from ChatGPT): a 2.5D flight simulator based on the Boeing 767.
Although this is my first Pygame project, the idea itself actually started a few years ago. Back then, I made a pretty similar flight game entirely by myself in Entry, which is a Scratch-like block-based coding platform.
Now I’m basically trying to take that old project and rebuild it into something much bigger and more detailed with Python and Pygame. My Python skills are still pretty limited, so I’ve been getting a lot of help from ChatGPT along the way while I learn, test things, find and fix problems, and gradually expand the project.
The simulator also supports a HOTAS joystick, so it can be flown with an actual flight controller instead of just a keyboard. Aside from Pygame, I’m currently only using standard Python modules rather than any dedicated 3D or game-engine libraries.
So far, I’ve mostly been working on the actual flying part of the simulator. There are still a lot of things I want to add, including a proper lobby/menu, airborne objectives, system failures, time-of-day changes, and plenty of other systems. I’m planning to build those up little by little as the project develops.
As you can see in the video, there isn’t anything too crazy or impressive yet, but I’m hoping that by the time it’s finished, it’ll be something that can genuinely make people go “wow.”
It’s still very much a work in progress, so for now I’m planning to keep developing it bit by bit and occasionally post progress videos along the way. Once it’s finished, I’d also love to share more about the project and what went into making it.
There’s still a long way to go, but I hope I can show you guys how much it improves over time!
Also, some of the UI elements shown in the video are still in Korean, and I used AI to help translate and write this post as well. My English isn’t very good, so I figured it would be better to get some help with the translation. Hope you don’t mind!
r/pygame • u/Life-Interaction-599 • Sep 10 '26
Untitled Horror Game Engine
Thought I should post about this too.
This is a side-project I started out of fun and curiosity. The game takes ideas from Roblox Doors and the Corpse Party series (especially the OSTs).
This video IS up-to-date with the game's latest version.
r/pygame • u/PotpourriHam • Sep 10 '26
How do I add checkpoints?
Hello! Im making a small game in pygame similar to flappy bird and I wanted to add a checkpoint after a certain amount of pipes are passed. This checkpoints would be counted to separate "levels". How can I create checkpoints?
r/pygame • u/Percefia • Sep 09 '26
I'm looking for someone who could help me with a game jam.
Hello Reddit!
I'm looking for someone who could help me with the PyWeek game jam to code a game using Pygame.
I'm just getting started with the library, but I'd be really motivated if someone could help me make a game!
Have a great day!
r/pygame • u/Rollgus • Sep 09 '26
How do i rotate a rectangle?
I want to make a rocket simulation in Pygame, but I'm having trouble rotating the rocket. I tried using some surface transform.rotate stuff, but it seemed to only want to turn it 90 degrees, as degrees in between would show a distorted transformation of the rectangle. Rotating only 1 degree at a time showed that it only transformed the image between the 90 degrees rotations by distorting growing and shrinking to fit the new shape. This might be a problem with how I approached it. But do anyone one know how I can do it?
If there is no way to do this. Do anyone have other recommendations for how I can make my rocket simulation?
r/pygame • u/rorythpsfan • Sep 09 '26
Flippin Sketchy Demo with live global leaderboard is now up on Itch.io!!
galleryso unfortunately my tablet that i create assets with has bitten the dust, so I'm working on getting the leaderboard working!
Its my first time making a leaderboard so it may be a bit buggy! If you encounter any issues let me know and ill try to figure it out!
I have a media server that runs 24/7 so I thought it'd be cool to implement a 24/7 live leaderboard, you should be able to enter a name at the end of your first score run and then every run after that should automatically submit with that name. The runs are only 30 seconds atm but I may extend it to 1 or 2 mins but for the testing i think that should be okay!
If you want to give it a try the link to the itch page is:
Flippin' Sketchy Demo
If you do decide to try it and you beat my score let me know!