Questions tagged [pygame]

Pygame is a portable Python package for video games, built on SDL.

Filter by
Sorted by
Tagged with
23
votes
1answer
46k views

Snake game using PyGame

I wrote a simple Python snake game which is about 250 lines of code. Can someone give me some advice on how I can refactor/make it better? game.py ...
10
votes
1answer
4k views

Pong with Pygame

Just looking for some pointers on how I could improve the code. This is my first game ever and python is my first language so it's bit messy but I'll be happy to explain stuff if needed. I'm kinda ...
2
votes
1answer
217 views

Multifunction sprite class for pygame

I've written a class that allows me to easily create sprites on the screen, and then do things like: setting an image or an animation; move the sprite as a platformer or as a top down game; and test ...
8
votes
1answer
320 views

Grid displayer: Game of Life and Langton's Ant

Re-use Given that both the Langton's Ant and the Game of Life use a grid, I decided to code a generic grid_diplayer code and use it both for GoL (Game of Life) and ...
8
votes
2answers
905 views

Golf game boilerplate

I wrote a program in pygame that basically acts as a physics engine for a ball. You can hit the ball around and your strokes are counted, as well as an extra stroke for going out of bounds. If I do ...
11
votes
2answers
487 views

SimCity clone performance

I am working on a SimCity clone, and I am noticing a drop in frame rate as I add more objects to my map, now this is expected, but, when I fill the whole screen, the game maintains about 300 FPS. ...
8
votes
4answers
768 views

Noughts and Crosses in Python using the pygame module

I've created a Noughts and Crosses game in Python using pygame, and I'm quite pleased with the result that I've produced. I've managed to reduce the code to what it is now, as it used to be much ...
3
votes
1answer
112 views

Class modelling for a shogi notation reader

I have made GPL software in GitHub whose purpose is reading shogi notations (shogi is Japanese chess). I have been told that my software modelling is underdeveloped in this question and advised to ...
10
votes
3answers
876 views

First Chess project

I'd made a project using pygame in python around 3 months ago. This was my first big project after I started learning how to program in college. Now I'd like to know just how good my programming ...
6
votes
1answer
150 views

Flappy Bird Style Game in Space Setting

Simple game where you control space shuttle with mouse click and try to avoid meteors moving in random speed toward you. There are some things I am still developing like rotation and menus, but wanted ...
5
votes
1answer
1k views

Pygame menu to launch games - follow up

Follow up of Pygame menu to launch games I rewrote most of the code per the one answer. I'm looking for further advice to improve to the code. I'm afraid some of the abstraction may be too Java-like. ...
5
votes
1answer
2k views

Tic Tac Toe in PyGame

This is my first python/pygame program. Instead of using images I tried drawing with pygame.draw.line() and pygame.draw.arc() ...
5
votes
1answer
1k views

Koch snowflake in Python with numpy and pygame

I've drawn a Koch snowflake with Python 3. I'm new to the Python world and would appreciate all feedback on how to make the code more Pythonic as I'm not used to these idioms, styles and modules. All ...
4
votes
1answer
968 views

Pygame Slideshow

I have written a basic slideshow program that uses pygame to manage the display screen. It cycles through all pictures files in the directory and sub-directories. There is a user configuration section ...
3
votes
1answer
2k views

Pygame menu to launch games

I made a menu to display a list of games and their info so that they can be uniformly launched from an arcade cabinet like set up. I was asked to do it in Python so I learned python using this and ...
2
votes
1answer
675 views

Snake in Python Pygame

I just now got around to implementing a full snake game in Pygame. The player can move his snake with the arrow keys and as in the original, the snake continues to move in the direction of the last ...