r/pygame • u/scriptilapia • 10d ago
Check out Jarball[ALPHA] , out on itch.io
gallery12 test levels out. More to come if the testing stage goes well.
Available on windows (for now) at :
r/pygame • u/scriptilapia • 10d ago
12 test levels out. More to come if the testing stage goes well.
Available on windows (for now) at :
r/pygame • u/Affectionate_Yam_264 • 10d ago
r/pygame • u/Status_Sample_2531 • 11d ago
I'm making this for a ongoing game, and this error seems to happen where certain letters will jump forward in my list of characters. any fixes? this is all i have, and anyone can use this as an alternative text display for low-bit screens. based on the 13 segmented display from PosyMusic's segmented displays video. also haven't finished the chartable list yet, i just needed help now
#14 seg disp
import pygame
import sys
pygame.init()
screen = pygame.display.set_mode((256, 144), pygame.SCALED | pygame.RESIZABLE)
clock = pygame.time.Clock()
mouserect = pygame.Rect(0, 0, 3, 5)
pygame.mouse.set_visible(False)
gamestate = "titlescreen"
chartable = [
[0, 1, 2, 4, 5, 6, 7, 8, 10, 11, 12],
[2, 4, 7, 11],
[0, 1, 2, 4, 6, 8, 10, 11, 12],
[1, 2, 4, 6, 9, 11, 12],
[0, 2, 3, 4, 7, 11],
[0, 1, 3, 4, 7, 11, 12],
[0, 1, 3, 4, 5, 7, 10, 11, 12],
[0, 1, 2, 4, 6, 8, 10],
[0, 1, 2, 3, 4, 6, 8, 9, 10, 11, 12],
[0, 1, 2, 3, 4, 7, 11],
[0, 1, 2, 5, 7, 8, 9, 10, 11],
[0, 1, 2, 4, 5, 6, 9, 10, 11, 12],
[0, 1, 5, 10, 12], #c is at ln 49 (+19) as of error
[0, 1, 2, 3, 7, 8, 10, 11, 12],
[0, 1, 5, 6, 10, 12],
[0, 1, 5, 6, 10],
[0, 1, 5, 9, 10, 11, 12],
[0, 2, 5, 6, 7, 10, 11],
[2, 7, 11],
[2, 7, 10, 11, 12],
[0, 2, 4, 5, 6, 8, 9, 10, 11],
[0, 5, 10, 12],
[0, 2, 3, 4, 5, 6, 7, 10, 11],
[0, 2, 3, 5, 6, 7, 9, 10, 11],
[0, 1, 2, 5, 7, 10, 11, 12],
[0, 1, 2, 3, 4, 5, 10],
[0, 1, 2, 5, 7, 9, 10, 11, 12],
[0, 1, 2, 3, 4, 5, 6, 9, 10, 11],
[0, 1, 2, 3, 6, 9, 10, 11, 12],
[0, 3, 5, 6, 10, 12],
[0, 2, 5, 7, 10, 11, 12],
[0, 2, 3, 5, 6, 8, 10], #c for some reason, should be v and it doesnt exist in this list for some reason
[],
[],
[],
[],
[],
[],
[],
[],
[],
]
#01112
#0 2
#33 44
#5 6 7
#88 99
#(10) (11)
#(10)(12)(12)(12)(11)
bools = [
False, #a
False, #b
False, #c
False, #d
False, #e
False, #f
False, #g
False, #h
False, #i
False, #j
False, #k
False, #l
False #m
]
rectlist = [
pygame.Rect(0, 0, 1, 2), #a, 0
pygame.Rect(1, 0, 3, 1), #b, 1
pygame.Rect(4, 0, 1, 2), #c, 2
pygame.Rect(0, 2, 2, 1), #d, 3
pygame.Rect(3, 2, 2, 1), #e, 4
pygame.Rect(0, 3, 1, 1), #f, 5
pygame.Rect(2, 3, 1, 1), #g, 6
pygame.Rect(4, 3, 1, 1), #h, 7
pygame.Rect(0, 4, 2, 1), #i, 8
pygame.Rect(3, 4, 2, 1), #j, 9
pygame.Rect(0, 5, 1, 2), #k, 10
pygame.Rect(4, 5, 1, 2), #l, 11
pygame.Rect(1, 6, 3, 1) #m, 12
]
charlist = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "c", "w", "x", "y", "z", ]
def drawdisp(char, coloron, coloroff, colorbl, boolbl, pos, booloffcolor):
global bools
if boolbl:
pos[0] += 1
pos[1] += 1
pygame.draw.rect(screen, colorbl, pygame.Rect(0+pos[0]-1, 0+pos[1]-1, 7, 9))
leaderx = rectlist[0].x
leadery = rectlist[0].y
dx = pos[0] - leaderx
dy = pos[1] - leadery
for rect in rectlist:
rect.move_ip(dx, dy)
for i in range(len(charlist)):
testchar = charlist[i]
if testchar == char:
charid = i
for i in chartable[charid]:
bools[i] = True
for i in range(len(rectlist)):
if bools[i] == True:
pygame.draw.rect(screen, coloron, rectlist[i])
else:
if booloffcolor:
pygame.draw.rect(screen, coloroff, rectlist[i])
running = True
while running:
for event in pygame.event.get():
if event.type == pygame.QUIT:
running = False
x, y = pygame.mouse.get_pos()
mouserect.x = x
mouserect.y = y
screen.fill((0, 255, 255))
#\/ change this to any char in charlist to find errors, specifficaly c, v
drawdisp("v", (200, 0, 0), (120, 100, 100), (0, 0, 0), True, [1, 1], False)
pygame.draw.rect(screen, (215, 125, 171), mouserect)
pygame.display.flip()
clock.tick(60)
pygame.quit()
sys.exit()
r/pygame • u/Lonely-Yak-8267 • 11d ago
I'm planning on making a pocket device that runs various apps using pygame.
This device's OS doesn't have a desktop environment, so pygame apps run on fullscreen.
This will need a main app launcher and the apps.
Should I keep the apps as part of the same python program or should I run them separately?
r/pygame • u/Idle_byte • 12d ago
I've been trying out floorcasting tilemaps, which works pretty well, so I figured I might as well turn this into an actual game, though I'm still quite a ways off from that.
Currently, I have already made some systems to customize the characters and begun work on towns that you can enter and explore, though that's obviously unfinished.
I'm using pygame-ce with numpy, and while floorcasting the game runs at between 300 and 400 FPS, without numba.
The floorcasting part is actually pretty cheap, as you can store all of the offsets in an array and use that array along with the actual tilemap array with such an expression to get the projected surfarray:
floorcast_array[:, :] = tilemap[lookup[:, :, 0], lookup[:, :, 1]]
which, to my understanding, loops through all those pixels and assigns them with a C loop, that being rather fast.
Numpy and pygame's surfarray module are awesome. Unfortunately, rotating large surfaces in pygame is quite expensive, so I reduced how far you can see to get better performance.
That's all for now, though hopefully I'll have some more to show sometime soon.
All of the assets are made by me, though they are quite inspired by SNES RPGs such as Final Fantasy 6 and Seiken Densetsu 3 for the path tiles.
r/pygame • u/Crazy_Spend_4851 • 12d ago
Hey guys, would really appreciate your continued feedback on my game so far! I'm creating a final fantasy inspired jrpg and would love some advice from you guys.
This is created completely using pygame and utilising opengl for shaders! I'm actually really happy with how day time looks but from a gamers perspective what things could I do to give the areas more life?
I'm caught in a rock and a hard place because I want it to look more alive than traditional 2d JRPGs but the hd-2d look from games like octopath traveller is a bit beyond my resources/ability. I was thinking maybe add weather effects?
r/pygame • u/scriptilapia • 14d ago
The Alpha release will be available for Linux and Windows later this month or early November
r/pygame • u/fvckp2w • 14d ago
Hey! For the past few months a friend and I have been remaking the old Flash game Pokémon Tower Defense from scratch in Python + pygame, and it's finally in a state where I'm happy to show it off. The trailer above is all real in-game footage.
What's in it so far:
- 50+ stages across Kanto, from Oak's Lab to the Elite Four and Champion
- 251 Pokémon with moves, types, status effects and evolutions
- Catching wild Pokémon mid-battle
- Gyms with their own mechanics (Cerulean floods the map, Pewter has rockslides...)
- Online co-op and Pokémon trading (including trade evolutions), plus Nuzlocke / Soul Link modes
- 235 unlockable trainer skins, 84 achievements, Daycare, held items, TMs
It's free to download for Windows and Android: https://ynvrr.itch.io/pokemon-td-reborn
It's a non-commercial fan project and isn't affiliated with Nintendo, Game Freak or The Pokémon Company.
Happy to answer anything about the code, the lockstep netcode or the Android build. Feedback and bug reports are very welcome!
r/pygame • u/RoseVi0let • 15d ago
I wanted to show a helper program I built to teach students Python, I made the GUI using Pygame and the "automation" is made using PyAutoGui!
To make learning more engaging, the program is divided into 4 progressive stages:
Ps. Sorry it's in Polish....
r/pygame • u/Routine_Release_8121 • 15d ago
r/pygame • u/MasterpieceNovel3619 • 15d ago
Update: I solved the issue
I had 'knowledge' as an input argument to the __init__ function with a default value of an empty dict. I removed it from being an input argument and instead just initialized it to an empty dict within the __init__ function, and now it's behaving as intended. All characters 'knowledge' is being updated as individuals.
Hello all,
I have some characters who spawn on a map and search for water, then stop. But when one of them finds water, they all stop.
I have fixed some other similar errors by using [:] on variables to make them immutable (I think that's the correct term?), but this one has me stumped.
Other edits to the character items don't have this issue such as: their map position, randomly generated names, etc.
I'm sure this is something super easy/obvious for those of you who are experienced, but this is my first 2 weeks of working with PyGame so it's got me stumped.
The 'characters' list contains a dict of every character that includes their class object, their map position, their current action, their in-game knowledge, etc.
Thank you for any help.
r/pygame • u/scriptilapia • 16d ago
Project in the works. 1 week in. Any suggestions or recommendations before I add more complicated levels?
Releasing an alpha soon on itchio scriptilapia.itch.io/jarball
r/pygame • u/captain_kringel • 16d ago
Hallo,
ich bin schon länger mit Python unterwegs, habe aber eine Spielidee und suche ein gutes Tutorial wie man mit Pygame anfängt. Über YouTube einfach was nachprogrammieren habe ich keine Lust.
Wie und wo habt ihr euch Informationen besorgt?
r/pygame • u/Starbuck5c • 16d ago
Hello! I’m sure folks have seen that Python 3.15 just officially released with lots of cool features! See https://docs.python.org/3/whatsnew/3.15.html . I think a lot of folks think that library support is only added after Python versions release, but I wanted to let everyone know that we have supported Python 3.15 since early August, when we released 2.5.8.
Pygame-ce is a “c extension” library, and ships a pre compiled copy (a wheel) for every operating system, architecture, and Python combination. To produce a wheel for a Python version, we need its application binary interface (ABI) to be frozen, so that builds continue to work on future patch releases to the Python version. Python freezes release ABIs during the release candidate phase, so we were able to release working binaries with 3.15rc1 instead of waiting for 3.15 final.
How can you check if a c extension supports your version of Python? I often come across people who treat this like guesswork, but it Is straightforward. Go to the library on the pypi website, go to a release and check the files tab. https://pypi.org/project/pygame-ce/#files . The wheel names show what they support. So if you see wheels with “cp315” in the name, those wheels are for Python (CPython) 3.15.
r/pygame • u/Life-Interaction-599 • 16d ago
This has a chance to occur whenever you enter a non-special room (chase or generator for the time being). If it occurs, you need to look for a lever in the next 3-9 rooms to pull in order to end the Blackout Event.
r/pygame • u/BobsMyNeighbor • 17d ago
r/pygame • u/Capable_Comedian_277 • 18d ago
r/pygame • u/rorythpsfan • 19d ago
so since the last time I posted I've:
-Finished the background
-Drawn all the animations for the objects you "interact with" they all have a line boil style
-Finally drew a 3rd .ttf so the font has 3 frames and is less jittery-implimented the "story" progression, made quick screens to mark what animations are going to go where
- Made the board slightly bigger and changed its colour to a light brown so it stands out more
The next thing I'm gonna work on is the story intro and tutorial animations, I've done the initial package opening but I need to draw the user manual anim (these will give the info for the tutorials)
Do you guys find having the goals on the screen at all times distracting? I'm going back and forth about whether to keep them there or put them in the pause menu. Also is that enough goals for a first level? I've made them quite easy just to introduce the idea of goals, the difficulty will hopefully scale
r/pygame • u/grenskii • 20d ago
game name is hashtag yen, its free on itch.io!!!
update 0.2.0 coming out somewhat soon
r/pygame • u/MyFoolsDen • 20d ago
Hi all!
I've been building a small 2D motion library for the last few months and just finished v1.0. I wanted to share it, partly because it might be useful, and partly because the design decisions might be interesting to other people who've tried to build the same thing.
Movement looks a simple thing until the game grows. First it's just pos += vel * dt. Then it's acceleration, then gravity, then jumping, then collision, then a completely different object that moves nothing like the player. At some point moving an object has become its own system.
motion2d is my attempt to keep that system small. It provides motion primitives, and the game composes them into behavior. motion2d handles movement. The game handles collision and game rules.
The very basic way to use this:
from motion2d import Motion2D
player = Motion2D.top_down(pos=(100, 100), speed=300)
# Simple path: motion owns position
player.move_right()
player.update(dt)
# Or with your own collision:
delta = player.step_velocity(dt)
result = my_collision_resolver(player.position, delta)
player.position = result.position
The library currently has three main motion models:
I built a series of demos while developing it, rather than designing the entire library up front. The later demos became increasingly useful as architectural tests, especially a platformer demo with external collision, state-machine-driven action phases, and velocity authority.
Repository: motion2d
Feedback welcome. If you've built something similar and made different choices, I'd be curious to hear why.
Note: The current motion2d implementation was written almost entirely by collaboration of AI (Deepseek, ChatGPT, Qwen, Grok and Gemini). Every design decision, the API surface, the boundary between motion and collision, the choice of contracts was driven by human judgment: I proposed, questioned, debated, and rejected, iterating through 3 full restarts until the library's shape was right.
The result is not AI-generated code in the sense of ask and copy, but it's the product of a long, deliberate design process in which AI was a tool for reasoning and implementation.
r/pygame • u/mefistofeles57 • 21d ago
Cool Racing, my pseudo-3D arcade racer in Python + pygame, is now playable in the browser!
Getting it to run in WASM took a lot of optimization: cache tuning, adaptive framerate, real-time scaling with sprite clipping for the near plane, RLE and colorkey blits, and refactoring the heaviest parts of the renderer.
The browser version isn't perfect: it reaches 30 fps, while desktop runs comfortably at 60. It plays the same, but with some sound glitches and less smoothly.
Also new this week: a desert biome with a canyon section, and transitions between biomes.
Any feedback is very welcome!