r/pygame • • Mar 01 '20

Monthly /r/PyGame Showcase - Show us your current project(s)!

85 Upvotes

Please use this thread to showcase your current project(s) using the PyGame library.


r/pygame • • 1h ago

Flippin' Sketchy- Outline of the Tutorial animations implemented! Ollie Tutorial a bit bugged but its on the to do list

• Upvotes

I'm in the process of colouring the animation but wanted a break from drawing so i implemented it into the game so i can just drop in the .pngs in the folder when im done.

I'm not sure why the Ollie registering is bugged but I will investigate the code over the next few days and see what im doing wrong, im also having the occasional issue of the spawn point trapping the player in side the desk making them unable to move, I think this one is because i moved the desk park object up a few pixels recently so i need to change the spawn point to reflect that.

Once I've coloured all the Tutorial animations I'll update the demo on my Itch page to include everything up to the second level, I'll keep the downtown level is the high score runs though.


r/pygame • • 12h ago

Single-Threaded Minecraft Clone - No Hardware Acceleration

16 Upvotes

Quick demo of the single threaded minecraft clone I've been working on recently. It uses 2d simplex noise for infinite procedural terrain generation.

Its done completely in Pygame. No ModernGL or other hardware acceleration.


r/pygame • • 21h ago

Made in PyGame --- Lexi Chameleon --- Swap out words in famous texts and lyrics without your friends noticing! (play in browser, online multiplayer, open source)

4 Upvotes

r/pygame • • 1d ago

My second ever game in pygame

20 Upvotes

And it works on pydroid. I've made better games since, but this was one of my first.


r/pygame • • 1d ago

Is it possible to make a 2D open-world driving game like GTA with Pygame?

9 Upvotes

Hi, I'm a student from Switzerland who has to do a five-month final school project. (I'm not in university; I'm still in compulsory school, but I'm in my last year, which is why it's my final school project.)

The task is to work on a project of my choice for five months, document it, and write a paper about it at the end, as well as present the work I've done.

Because I'm interested in coding and computer science, want to do an apprenticeship in software development after school, and have taught myself Python and a bit of Pygame, I think it would be a good idea to build a game with Pygame as my project.

I've always wanted a game where you can just drive around a city or an open world and enjoy the atmosphere of driving. So my idea was to create a game like that with Pygame, in a 2D style similar to the first GTA games.

But my programming skills aren't that good yet, and I'm not sure if five months will be enough time to complete the game. On the other hand, five months is still quite a lot of time, and I could learn a lot from YouTube tutorials and other resources that would help me bring this game idea to life.

So far, I've built a GUI calculator with Tkinter, an investment simulator that uses terminal input, and a Snake game in Pygame. I'm currently working on a Tetris game in Pygame.

You can check out my projects on GitHub:
https://github.com/TimFloClausen

So, do you think it's possible for me to bring this project to life in five months, given my current skill level?

Thanks for your answers! :)


r/pygame • • 1d ago

My psychological horror hacking game is finally out! You use real terminal commands and live CCTV to guide your team.

3 Upvotes

Hey guys,

I’m a solo dev, and my story-driven hacking puzzle game, EchoNet, just released on Steam!

Instead of fake hacking minigames, you are dropped into a custom OS. Your only connection to the outside world is an IRC chat and live CCTV cameras. You have to use real terminal commands to crack servers, intercept files, and coordinate with your crew.

But there’s a catch: the stress of the job drains your Sanity. If you don't manage your meds, the CCTV feeds corrupt, and you start hallucinating while the clock ticks down.

📺 Check out the gameplay footage here: https://youtu.be/KldYA8cVdnc?si=EUyxTYzX24k67Pw9

🎮 The game is currently on sale on Steam: https://store.steampowered.com/app/5222620/EchoNet

I'd love to know what you think of the atmosphere! (And good luck finding the hidden backdoor IP 😉)


r/pygame • • 2d ago

I wanted to bring the visuals of my upcoming game to a new level, so I implemented normal maps and interactive light sources to get this 3D look.

31 Upvotes

Steam Page for anyone interested!


r/pygame • • 2d ago

Finally my demo is out!

Thumbnail gallery
20 Upvotes

Hey everyone!

After a long journey, I've finally launched my game's demo on Steam!

Caracol – Wars of Religion in the 17th Century is a historical turn-based strategy game built entirely with pygame-ce, OpenCV and Shapely.

If you have a moment, I'd really appreciate it if you could check out the demo, give it a try, and consider wishlisting the game. Every bit of support makes a huge difference!

Steam: https://store.steampowered.com/app/4701930/

Thanks so much ❤️


r/pygame • • 2d ago

My trees launched cars into orbit, so I turned them into rubber trees

Post image
9 Upvotes

Still working on Cool Racing, my pseudo-3D arcade racer. This week I went back to the physics. At first I’d used a “textbook” collision response as a temporary placeholder, but I didn’t like how it felt, so I rewrote it with more arcade-like behavior.

When you hit the scenery, the elastic collision gave the car all the energy of the impact, and it went flying. But when you hit another car, the energy was split between both and you barely noticed it. I wanted exactly the opposite: hitting the scenery bounces you back to the middle of the road with some speed loss, but crashing into another vehicle knocks you off your line and punishes you hard.

You don’t need complex formulas for this. I calculate the normal from the impact point, then apply a fixed bounce plus a variable one that depends on the combined speed of both vehicles.

The game now feels more predictable and fairer, and it’s nicer to drive. You know a crash will cost you, but it won’t ruin your race, and you roughly know how much it’ll cost.

Other news in v0.3.2: a new meadow biome, trucks, and music while you drive. It’s out now on itch.io and playable in the browser.

How do you handle collisions in your games: realistic physics or arcade rules?


r/pygame • • 1d ago

HELP ME

Post image
0 Upvotes

I’m making a game with AI (yes, I know that’s a bad idea, but I’m not very good at Python). I’m looking for someone to help me out—Claude can no longer continue with the development because of some random issue.


r/pygame • • 1d ago

HELP ME

0 Upvotes

I’ve been building a game in Python with the help of AI (I’m not actually that great with Python myself). I’d like to finish the project by collaborating with a real person, as I’m currently hitting some limitations. (Everything shown in the screenshot was created by AI.)

Processing img k74r518ignwh1...


r/pygame • • 2d ago

Memory leak when rapidly generating and destroying Surface objects with convert_alpha() in a custom particle system

4 Upvotes

Need help.... I am running into a persistent memory leak in my project and could use some advice from anyone who has built complex particle systems in pygame.

I have a custom particle system where each particle is a unique pygame.Surface. Because the particles fade out over time, I apply a per pixel alpha fading effect. I generate these surfaces dynamically and call convert_alpha() on them before blitting.

When my particle count exceeds 500 per frame, my RAM usage steadily climbs by about 10MB every minute. It never garbage collects. If I remove the convert_alpha() call, the memory leak stops, but my particles lose their transparency effect. any suggestions? am I missing anything??


r/pygame • • 2d ago

How does one scale for different resolutions?

8 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 • • 4d ago

I rewrote wolfenstein 3D from scratch in pygame

102 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 • • 5d ago

Experiment: roll and dash (sonic movement)

32 Upvotes

r/pygame • • 5d ago

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

Thumbnail gallery
2 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 • • 5d ago

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

Thumbnail github.com
4 Upvotes

r/pygame • • 5d ago

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 • • 6d ago

pocket device

3 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 • • 7d ago

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

45 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 • • 7d ago

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 • • 8d ago

Core mechanics established , now adding levels

6 Upvotes

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

https://scriptilapia.itch.io/jarball


r/pygame • • 9d ago

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

37 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 • • 9d ago

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....