r/pygame • • Oct 19 '26

How does one scale for different resolutions?

9 Upvotes

I’m making a game using pygame with a planned artstyle that will be smooth, not pixelart.

I made a rough draft of the game and it works well, but I set a fixed resolution. I use a combination of pg.draw calls and saved pngs (which I turn into a surface when the game boots and store in a variable in my config script so the game doesn’t stutter later on).

I don’t know how I can make the game playable while looking smooth for all resolutions (up to and including 4K) without rendering the game at 4K and scaling it down which would tank the performance. How does one get around this problem?

As a sidenote I’m also curious as to how the game can look good without stretching to match other aspect ratios than 16:9.


r/pygame • • Oct 17 '26

I rewrote wolfenstein 3D from scratch in pygame

108 Upvotes

Hello fellow pygame developers, I wanted to share a side project I have been working for a couple of months now. I present you: pywolf3D! A wolfenstein 3D engine, game clone I wrote from scratch; in pygame. It has been a very fun and tough journey, it is nowhere near perfect or complete in my opinion, but I wanted to share it anyways. I have lots of more stuff to implement and plan to write a blog on my findings and such. The clone uses raycasting like the original and implements rendering very similarly, no real rasterization is done. I tried to keep it similar to the original experience. You can play it yourself too! https://github.com/atifcodesalot/pyWolf3D clone this repo and follow the instructions on README.md. And of course as always, contributions are welcome :D And before anyone asks: no, I didn't use AI for the code, not even debugging. Have fun!


r/pygame • • Oct 17 '26

Experiment: roll and dash (sonic movement)

35 Upvotes

r/pygame • • Oct 17 '26

Check out Jarball[ALPHA] , out on itch.io

Thumbnail gallery
4 Upvotes

12 test levels out. More to come if the testing stage goes well.

Available on windows (for now) at :

https://scriptilapia.itch.io/jarball


r/pygame • • Oct 16 '26

Hello this is my first game I made this using python please show some love

Thumbnail github.com
4 Upvotes

r/pygame • • Oct 16 '26

custom 13 segment display in pygame-ce

3 Upvotes

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 • • Oct 16 '26

pocket device

4 Upvotes

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 • • Oct 15 '26

Floorcasting using numpy and some animation for a RPG I'm working on

46 Upvotes

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 • • Oct 15 '26

I Created Final Fantasy!!!! 3 Years Of Solo Dev

Thumbnail youtu.be
19 Upvotes

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 • • Oct 13 '26

Core mechanics established , now adding levels

7 Upvotes

The Alpha release will be available for Linux and Windows later this month or early November

https://scriptilapia.itch.io/jarball


r/pygame • • Oct 13 '26

I've been building a Pokémon Tower Defense remake in pygame with a friend: 50+ stages, co-op multiplayer and trading (Windows + Android)

38 Upvotes

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 • • Oct 12 '26

Helper program I built to teach students Python

9 Upvotes

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:

  1. Mouse Control: A simple tutorial demonstrating basic cursor movement and positioning.
  2. Text & Keyboard Automation: Practicing typing, clipboard operations (copy/paste), and keyboard shortcuts.
  3. Image Recognition & Alerts: Using computer vision to detect screen or wallpaper changes (such as unexpected pop-ups) and triggering an alarm.
  4. Full Project (Cookie Clicker Bot): Combining all the functions together to build a mini bot that plays Cookie Clicker—recognizing buttons, collecting cookies, and purchasing upgrades automatically!

Ps. Sorry it's in Polish....


r/pygame • • Oct 11 '26

Pygame DAW WIP

21 Upvotes

r/pygame • • Oct 11 '26

Ongoing project

14 Upvotes

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 • • Oct 12 '26

I made my first game in Python — an audio-based maths game

Thumbnail reddit.com
2 Upvotes

r/pygame • • Oct 12 '26

2 Free games I made with Claude code

Thumbnail github.com
0 Upvotes

r/pygame • • Oct 11 '26

PSA: pygame-ce supports Python 3.15

14 Upvotes

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 • • Oct 12 '26

Seeking help: Edits to one of my characters are applying to all

Post image
3 Upvotes

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 • • Oct 11 '26

Gute Pygame Tutorial

1 Upvotes

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 • • Oct 11 '26

Blackout Event

6 Upvotes

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 • • Oct 11 '26

Upcoming update

Thumbnail reddit.com
0 Upvotes

r/pygame • • Oct 10 '26

i made a video about 3d games in pygame

Thumbnail youtube.com
18 Upvotes

r/pygame • • Oct 09 '26

Updated enemy8, enemy9, snake1 respawn, snake1 growth

7 Upvotes

r/pygame • • Oct 08 '26

Flippin' Sketchy: Desk "Park" Done! use linear interpolation for the 3d room effect, and other stuff!

20 Upvotes

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