r/pygame

▲ 7 r/pygame+1 crossposts

I built a 24/7 endless fish survival game using Pygame with procedurally generated music

Hey everyone,

I created a 24/7 live-streamed project where a fish swims, eats and grows endlessly using Python and Pygame.

​Everything is built from scratch using pure geometry and vector math, which removes the need for external image assets. For the background music, I used numpy to generate continuous procedural pentatonic-scale tones to avoid copyright issues.

​The script runs 24/7 with optimizations to keep CPU usage and memory stable during the infinite loop. You can see it running live here:

Youtube live

u/Leadertoleader — 6 hours ago
▲ 0 r/pygame+2 crossposts

Feather Engine - A new Python game engine, the simplest and most efficient yet

Hello r/gamedev!!

For the last few weeks I've been working on my first Python module, Feather Engine. Feather Engine is an incredibly simple and efficient engine built on top of Pygame CE. I am working as hard as I can with my team, but I need contributors!!

Contributors get a special mention on our GitHub page, with a link to your Reddit profile, or another platform at your choice.

To contribute just go to https://github.com/TheCodingChihuahua/Feather-Engine-dev and try it out, report any errors in Issues, feel free to change code/game.py to test for errors, make sure to include a link to your social page so I can credit you when the official one comes out!

This is what Feather code looks like right now:

from feather import Sprite
import feather
import pygame


player = None



def init():
    global player
    player = Sprite("./assets/player.png", 100, 100)



def update():
    global player
    keys = pygame.key.get_pressed()


    if keys[pygame.K_LEFT]:
        player.x -= 5
    if keys[pygame.K_RIGHT]:
        player.x += 5
    if keys[pygame.K_UP]:
        player.y -= 5
    if keys[pygame.K_DOWN]:
        player.y += 5


    if player.x > 700:
        feather.end()



feather.run(init, update)

In the future it won't require pygame along with it. This is only the first official version.

u/TheCodingChihuahua — 10 hours ago
▲ 10 r/pygame

Tilemap editor for pygame

https://preview.redd.it/10m2jibevckh1.png?width=2514&format=png&auto=webp&s=3d238a0231580fde9c9ba255dcffb875b35f91b2

https://preview.redd.it/45pvjrgkvckh1.png?width=2822&format=png&auto=webp&s=906d7ba7cf72c530d01cc4437c1f58008a1c0e30

https://preview.redd.it/5kcej2y5wckh1.png?width=2184&format=png&auto=webp&s=30ea83a6cc8f3bc2aaf8667bda4aee5ce3bef4bf

https://preview.redd.it/pg1hjdn8wckh1.png?width=2010&format=png&auto=webp&s=90685f954daedcdd49a56b0a719814d8124bc3ca

https://preview.redd.it/9jso902dwckh1.png?width=2300&format=png&auto=webp&s=a23835ceacca4e7ac54b6fb57866f056595cf9c2

Hello guys i have made tilemap-editor package thats fully based on pygame-ce and 0 dependencies.
I have made small demo game if you are interested..

It can simply be used this way:
- `pip install tilemap-editor`
- tilemap-editor init(generates settings.json very important)
- tilemap-editor run

Note: always use virtual environment

or simply
```
import Editor from editor
Editor().run()
```

Features:
- fully json output
- Few existing themes and fully customizable themes
- tilemap canvas
- godot like convex polygon collision editor and multi region object collision editor(polygon based)
- animation editor
- 3x3, 1x3 3x1 autotile
- own builtin filemanager
- object/grid and animated tileset in tree node structure with virtual folders(erased after exit)
- object/tile layer with layer locking and visibility option
- tile/object/tileset property editor
- area and particle nodes
- relative file path resolution
- hundred of particles emission with 60+ pre existing(some are weird but particle node are editable with config) like campfire, bonefire(used quantization and caching for optimization)
- character collision editor(capsule, rect and circle)
- small spritesheet editor for easy grid manupulation scaling, multi-region based images extraction
- render scale

If you are interested you can check : https://pypi.org/project/tilemap-editor/

If you want to know about it or learn it, its indexed in. deepwiki , you can ask question and look into it https://deepwiki.com/FluffyBrudy/tilemap

In case of those point/spotlight, i have made a live coding video though i have not spoken, i have explained with comment as i code in this video: https://youtu.be/LN7u20H7zK4

The map was inspired by youtuber dafluffypotato which i was hooked after the way he made platformer game. This tilemap is iterated version from the editor that he made one for his game, although this package has evolved with some/many idea from Godot itself. Sorry for bad ui and no wonder if you encounter bugs

reddit.com
u/VirusMission9156 — 13 hours ago
▲ 6 r/pygame+1 crossposts

Cupta serpant added by Tony

Tony added the Cupta unit, a serpent of dark magic who returned from the caverns and tries to siphon your life essence, with this git commit.

Tony also changed the control of player's direction from keyboard to mouse, making the player easier to control. But, this now only works when the mouse pointer is inside the game window. If it's outside the direction is still controlled by keyboard as before. So you can now choose the direction control that you prefer.

See the PythonLearningGame repo to add your own game elements to this collaborative project, or simply tell us what you would like to see added to the game.

previous PythonLearningGame post

u/Sea-Ad7805 — 18 hours ago
▲ 26 r/pygame+5 crossposts

my indie game, #?!¥?!# (or just hashtag yen for short) is out now on itch.io!!

its a funky roguelike with a bunch of random ideas i had. you basically take over hell. search hashtag yen or #?!¥?!# on itch io to download the game !! (keep in mind this is version 0.1.0, so its not the full version)

u/grenskii — 1 day ago
▲ 8 r/pygame

Pygame for Game Jams

Is using pygame vaiable for participating in game jams?

I participated in the JMTK game jam using pygame since I have used it for quite a long time now, but the issue i ran into is that I spent half the time I had just coding the rendering engine that can render Tiled maps and allow collisions with obstacles. I ended up not finishing it (I also had school so I could not spend all my time on it)

Does anyone have any advice for how to spend more time on actual game development and less time on building the base systems which you would get by default in a game engine like Godot or Gamemaker. Or is using pygame for a game jam a lost cause?

reddit.com
u/Secret-Patience-1693 — 2 days ago
▲ 24 r/pygame+1 crossposts

Currently making a 2 player PvP recreation of Pac-Man for an arcade cabinet I'm building soon. My first playable version is here!

I'll also be implementing unique player abilities to use during gameplay, such as rewinding time, drilling through a wall, summoning a fifth ghost, etc. Shown here is a basic round of gameplay between myself (ghosts) and a younger sibling (Pac-Man), albeit with potentially imbalanced match settings. The second round shows the custom maze capabilities (this one was drawn out by the same younger sibling), and an editor will be made eventually. Any feedback or ideas for the future are much appreciated!

Note: the 'loading' screen at the beginning was artificially extended to allow time to set up the screen recording. The audio garbling in the second round seems to be a problem with the recording, not the game.

u/StinkySlinky1218 — 2 days ago
▲ 1.5k r/pygame+6 crossposts

Bonsai just hit a 100,000 downloads on crates.io! 🎉

A little over 4 years ago I started Bonsai as a side project: a Rust library for building complex, deterministic AI behavior with behavior trees. It has since found its way into a wide range of applications.

The video shows two of them: on the left, a Titanfall 2 gameplay where all the players except the first person view is a NPC (bot) driven by Bonsai behavior trees. On the right, a robot from NASA lunabotics 2026 autonomously digging and dumping regolith in a simulated lunar environment – also powered by Bonsai.

A lot of the library's usefulness today comes from the community. Thanks to everyone who has contributed PRs, filed issues, and pushed it further than I would have on my own.

Repo link in the comments.

u/Sollimann — 4 days ago
▲ 11 r/pygame

Learning Python With the Goal of Making a Game — Any Advice?

It just came to my mind that I want to develop a game while learning Python programming. As I dig deeper, I realize there are a lot of things to learn. But I’m really patient and consistent, so I’m willing to put in the time. So, what are the things that really matter when your goal is to develop a game through programming?

reddit.com
u/Zlarc_d — 3 days ago
▲ 18 r/pygame

You Are the Parasite. The Body Is the Dungeon. APOPTOSIS Is Now on Steam.

Hey r/pygame! My game finally has a Steam page 🎉 I made the game with pygame, and I’m really happy to see it on Steam now. The demo will also be available in about a week. If you like the game, I would really appreciate a wishlist ❤️ It helps me a lot as a solo indie developer, and you will also get a notification when the demo is ready. Steam: https://store.steampowered.com/app/4936880/CellGrinder_APOPTOSIS/

u/oyuce_ — 5 days ago
▲ 36 r/pygame

Tessella, a (truly) declarative UI framework for Pygame

Hello everyone!

Over the last 20 months I've been working on and off on Tessella, a Flutter-inspired declarative UI framework for pygame. The idea is to build UIs of any shape or size by nesting widgets (25+ of them so far) inside one another, instead of hand-placing rects. Here's a minimal example, taken straight from the "Hello World" tab in the (very flashy) video above:

gui = Center(
    Container(
        child=Padding(
            padding=EdgeInsets.all(28),
            child=Column(
                shrink_wrap=True,
                children=[
                    Text(text="TESSELLA DEMO"),
                    SizedBox(width=0, height=10), # Spacer
                    TextWrap(text="Every screen is built by nesting widgets like these."),
                    SizedBox(width=0, height=20), # Spacer
                    Text(text="Quite simple, right?"),
                    SizedBox(width=0, height=10), # Spacer
                    Button(
                        key=WidgetKey(),
                        text="Hello World!",
                        width=200,
                        height=40,
                        on_click=lambda: print("Hello World!")
                    )
                ]
            )
        )
    )
)

The goal with Tessella was to fix a few problems most pygame UI setups run into: having to set rects and coordinates by hand (which makes responsive UIs a pain), and the lack of anything modular or scalable enough to fit projects of different sizes without dragging in a pile of boilerplate.

To get the example above on screen, all you need to do is call gui.calculate_layout, passing it a rect for the area you want the UI to occupy once at the start, and again on WINDOWRESIZED events. That's the entire responsiveness story. From there, Tessella figures out sizing and layout on its own, updates via gui.process_event and gui.update, and renders with gui.render, which also has a debug mode that draws the bounds of every widget, so you can see exactly why the layout ended up the way it did. You can see that in action toward the end of the video.

Tessella was a core part of a game I released on Steam a few months ago, Protocol: Umbra, and building a real project on top of it is what really pushed it forward. If it looks interesting, you can try it right now with pip install tessella, as well as check the docs or source for a quickstart and more examples:

Docs: https://tessella.readthedocs.io/en/latest/
GitHub: https://github.com/cuaitz/tessella

This is the first "real" release, so Tessella is still a bit rough around the edges, which means that feedback and contributions are very welcome!

More things are always on the way :)

u/Alternative_Bad_6755 — 4 days ago
▲ 13 r/pygame

Shipped my first solo game: a toilet-rush manager where all art is Python-generated and the entire soundtrack is synthesized at runtime

After months of evenings, my time-management game about running public restrooms for a demanding toilet god is live on Google Play. Wanted to share a few build details, and I'd genuinely value feedback from other devs.

Unusual choices that mostly worked out:

  • Every sprite in the game is emitted by Python scripts — characters, venues, a 24-landmark city map. No art program was opened in the making of this game. Changing the palette means re-running a script.
  • Zero audio files (except one recorded laugh). Both music loops and every sound effect are synthesized with the WebAudio API at runtime from note tables. When I wanted the title theme to sound like Chaozhou yingge drumming, that meant adding a pitch-bend parameter to my gong synth, which is a sentence I never expected to type.
  • It's Phaser 3 in a Capacitor shell, which meant one codebase but also meant discovering exactly how a WebGL canvas reacts when the Google Play billing sheet rotates your app to portrait mid-purchase. (Badly. It reacts badly.)

The game itself: drag desperate patrons to the right fixtures, manage etiquette and hygiene, 24 venues, endless mode, daily runs.

Store page: https://play.google.com/store/apps/details?id=com.mcs2k8.loogod

Honest feedback wanted — especially on difficulty pacing and whether the monetization (optional coin packs, opt-in rewarded ads) feels fair. Ask me anything about the pipeline.

u/OddCaterpillar5513 — 6 days ago
▲ 14 r/pygame+3 crossposts

Array 0.3.4 Shape of Space Update Out Now! - Devlog

Array - 0.3.4 Shape of Space by Obsidian Star Digital

Click here for my Discord!

​​Hello everyone! Once again thank you all for the support that you have been showing to Array! The Shape of Space update is finally here and with it comes a whole new level of generation possibilities, new space phenomena, and changes to the core of Array! 

I am very excited to get into this update as it is jam packed full of goodies for everyone, let's get right into it! 

SystemBuilder v11

SystemBuilder is the custom space engine that has been powering Array from the very beginning, finally it is getting a massive update with SystemBuilder v11. There are many new things coming in this update which bring some really fun things in-game and change generations as a whole! 

System Age

This expands on the previous SystemBuilder v10 update which added Proto-Systems, and dying suns. At generation each system is assigned an age which quietly influences everything else in that systems generation. 

https://preview.redd.it/3qbyiuzodfjh1.png?width=364&format=png&auto=webp&s=292bf309ac8aa2217da53f86f81f826a37e12efd

This is a massive change that makes each system feel more natural in its generation. A systems age is visible in the galaxy view.

Gravity Wells

Space itself now misbehaves. Gravity wells tear open at random, they drag nearby starships and asteroid miners toward their center, resisted by ship thrust, warships punch through while freighters slow, stall, or get pulled off course. 

https://preview.redd.it/ey7uxmdjdfjh1.png?width=622&format=png&auto=webp&s=5863e53d2c736438bc2db82f395a30984af41af4

They are pure disruption by design: a well never destroys anything, and a trapped ship drifts free when it expires. But a well sitting on a trade lane or over a battle will reshape it!

Trojan Asteroid Clouds

Rather than rings these asteroids spawn as clumps. With their own orbits.

https://preview.redd.it/vhsimx9idfjh1.png?width=700&format=png&auto=webp&s=9bc997ec4c27bb855aeabd722c95a9b998d95665

System Anomalies

Roughly one system in fifty hides something that should not be possible. Eighteen distinct anomalies can now generate: 

  • Hot Jupiter skimming its star
  • Colossal ring system visible across the map
  • Binary planet pair locked in mutual orbit
  • Moon larger than its parent dwarf
  • Captured rogue world on a decaying orbit
  • An interstellar object passing through
  • A planet orbiting BACKWARD against its whole system
  • Nearly polar orbits
  • Twin adjacent belts
  • A molten impact remnant ringed by its own debris
  • A broken planet reduced to a dense shattered ring
  • Brown dwarf companion carrying its own miniature system of moons
  • Habitable worlds warmed by two suns
  • Planets plowing through an asteroid belt
  • A moon with its own moonlet
  • Comet-like eccentric planets
  • Dead ancient systems with almost nothing left
  • Perfect resonant chain of orbits.

 

The galaxy tooltip names the anomaly, and the first time you enter such a system the game announces it. Happy hunting!

Expanded Asteroid Belts

Belt generation got a full overhaul. Systems can now stack up to three stellar asteroid belts, planets and moons keep their own local belts, and black-hole systems, previously empty of belts entirely, now guarantee one to two 'shattered' debris belts placed just outside the anomaly clearing making it prime but dangerous mining real estate. 

https://preview.redd.it/8ux1ci6hdfjh1.png?width=1218&format=png&auto=webp&s=50f25298e35e080100d2e1a89c78da259ec938ef

Belt identities are collision-proof, and multi-belt systems name themselves properly (Belt II, Belt III).

Outer System Generations

When generating new systems SystemBuilder will now generate outer system debris and POIs! 

Black Hole Palettes

Black holes recently got a massive update and look really awesome, however they all spawn looking the same with nothing setting them apart, now each black hole spawns with a distinct ring color! 

https://preview.redd.it/4n4up3vfdfjh1.png?width=625&format=png&auto=webp&s=495bc4b7cf0831fc58cbca1745f70742a4885228

Flight 2.0

Flight mechanics have been a staple since version 0.2.0, but they have always felt a bit too rigid and blocky for my liking. With Flight 2.0, space travel finally feels much more fluid! Fleets are no longer just a single sliding blob; instead, every individual vessel now calculates its own flight-model arc to find its place in the formation. 

https://i.redd.it/1i9zq4vadfjh1.gif

​Whether fanning out from a stack, swinging wide through high-speed turns, or settling into staggered positions upon arrival, the movement is dynamic and crisp. When entering orbit, fleets now string out beautifully along the orbital ring, creating a convoy wrapped around the world where each ship maintains its own tangent. 

https://preview.redd.it/rrpusrxddfjh1.png?width=1223&format=png&auto=webp&s=aa0f0e03fde8e03f480bdcdc5232193b65e86215

Every single transition glides perfectly, ships should never teleport, blink, or stack through one another! I am very excited to hear your feedback on these changes! What else should I tweak to make the flight experience even better?

Galaxy View QOL

Players can now toggle wormhole routes and starship gate route views in the galaxy and universe view for a cleaner gameplay experience while navigating these UIs.

https://preview.redd.it/zuhjllzuafjh1.png?width=1565&format=png&auto=webp&s=5953c1d5d9ade6db5b8e271471bd75fa2e23f36a

UI Clean Up

Across the game buttons and other UI elements have received some polish, this is the first part of a much larger modernization of the UI coming in the 0.3.5 Cleaning House update but wanted to call it out as most in game UIs have already been touched in some way. 

u/TPlays — 5 days ago
▲ 48 r/pygame+1 crossposts

Battle Tail, show what you can do

A Battle Tail is added with this git commit.

PythonLearningGame is a collaborative Python project using PyGame, just for fun and purely educational. We are looking for collaborators.

Surely some of you think you are pretty good with Python, then this is your chance to show us what you can really do besides writing know-it-all comments. Maybe add:

  • health pickups
  • shield
  • laser weapon
  • lock-on missiles
  • mines to drop
  • units shooting back
  • ...

See the PythonLearningGame repo for instructions.

previous PythonLearningGame post

u/Sea-Ad7805 — 8 days ago
▲ 17 r/pygame

Using pygame for the UI on my digital pedals software

Making this cause im planning on making these digital pedals work in a real raspberry pi pico plugged to a real guitar. any pedal in one, as far as digital pedals go

u/no_Im_perfectly_sane — 6 days ago
▲ 3 r/pygame

No collidepoint error

# Button
class RockButton:
    def __init__(self, x, y, collidepoint):
        self.x = x
        self.y = y
        self.image = rock_img
        self.rect = self.image.get_rect()
        self.event = 0

    def draw(self, screen):
        screen.blit(self.image, (self.x, self.y), self.rect)

rock_button = RockButton(350, 777, False)
rock_button_value = False

# Game loop
running = True
while running:
    screen.fill(bg_color)
    rock_button.draw(screen)
    pygame.display.flip()

    for event in pygame.event.get():
        if event.type == pygame.MOUSEBUTTONDOWN:
            if event.button == 1:
                if rock_button.collidepoint(event.pos):
                    if rock_button_value == False:
                        rock_button_value = True
                    else:
                        rock_button_value = False
                    print(f"{rock_button_value} - BUTTON")
        if event.type == pygame.QUIT:
            running = False

    pygame.display.update()    

    clock.tick(FPS)

pygame.quit()

Output:

Traceback (most recent call last):
  File "/home/user/Desktop/Project/main.py", line 101, in <module>
    if rock_button.collidepoint(event.pos):
       ^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'RockButton' object has no attribute 'collidepoint'

What did I do wrong?

reddit.com
u/ComprehensiveBid3793 — 6 days ago