Questions tagged [pygame]

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

Filter by
Sorted by
Tagged with
1
vote
1answer
74 views

A small to medium sized pygame game

Github Link To Code Pastebin Link I am well aware of how terrible the SettingsMenu class is, it's still a work in progress and is the way it is so it can actually work. Can't paste it directly in ...
6
votes
1answer
1k views

Python/Pygame Fighting Game

I've been working on a fighting game using python and pygame and its quite finished, currently I'm looking for some constructive feedback about any issues/functions I should change in my code. ...
3
votes
0answers
468 views

Using arecord through subprocess to record in Raspberry Pi

I am using arecord through subprocess to record in raspberry pi : press joystick button to start recording and press button again to stop recording. I am really a noob in programming. ...
1
vote
0answers
313 views

Core of a text based game displaying graphics in pygame

I'm working on a silly personal project, - a text based game with minimal graphics such as characters (people, not the text), enemies, gear, little effects. But the core of the game is the text and ...
7
votes
2answers
4k views

Ping Pong game in pygame

I wrote a very simple Ping Pong game using pygame and everything worked out quite well. The only issue is the high CPU usage, which seems a bit strange. One thread is immediately occupied up to 100% ...
5
votes
1answer
1k views

Gomoku in Pygame

I was playing around with the pygame module, and decided I should try to make a game. I like to play Gomoku, so that was the game I decided to make. It is my first experience with pygame, thus I'm ...
0
votes
1answer
947 views

Pygame Flappy Bird clone - Object oriented

Recently, I have been trying to improve my programming and coding skills in python so I have decided to make some games with the pygame module. I have made this flappy bird clone with pygame and ...
1
vote
0answers
75 views

Pygame Slideshow2 that uses Curses with SSH to pause and move Pictures

I have added a few new features to Pygame Slideshow that includes using curses that works with ssh, a way to move pictures to a different directory while viewing them, a pause, and redisplay mode. A ...
5
votes
1answer
176 views

Bare bones SNAKE game

This is the bare bones of a SNAKE game that I'm working on, the code runs as is, I've taken great care to keep my code clean and readable. I would appreciate feedback on my code. I plan on creating ...
5
votes
2answers
369 views

Optimizing a Text-To-Speech program with a lot of repetition

I have a Text-To-Speech program that will ask the user to input text, convert it to speech and then output that speech from within Pygame by loading the file into memory, getting Pygame to play the ...
4
votes
1answer
499 views

Creates a maze from file and enable user to go trough it with graphic display

I'm following the learnpythonthehardway.org book for learning Python. I recently made a one week projet and as I'm fairly new to coding program with POO and multiple files, I'd like to have someone ...
1
vote
1answer
418 views

Drawing pixel to pixel

I'm drawing a pixel by pixel image with the following code: ...
2
votes
2answers
1k views

Python snake game with pygame

I am a new programmer and I sill don't know how to write a clean code. please suggest me ways to improve my skill and how to write a proper code. ...
7
votes
1answer
1k views

First chess game

I am just new to programming I just have a 2 month experience in programming and a 2 week experience with python. This is my chess game written in python with pygame. Can some one help me how can I ...
7
votes
1answer
833 views

Car simulation to demonstrate screen wrapping

I have been interested in writing some code that allows an object to wrap around the screen. It turned out to be much simpler than I was expecting, so I kept working and changed the white box that I ...
3
votes
2answers
279 views

Maximize the number of PyGame sprites, with collision detection

I was trying to see what is the highest number of moving and colliding boxes (sprites) I could get in pygame? So that I could start working on game I want, I searched google and I found different ...
10
votes
1answer
3k views

Raycasting algorithm in pygame

For the past week, I've been developing a simple raycasting algorithm. And I've finally managed to work out how to add textures and to get everything working.as I'd like it to. However, even at a ...
5
votes
2answers
253 views

Custom Font Rendering Class Using Pygame

This is a simple custom font rendering class I wrote. The idea was to code something that could be passed a lengthy string and render that properly in any game that uses pygame. On top of this, the ...
3
votes
1answer
187 views

Snake videogame in Python

I made a Snake game in Python 3 with pygame. Please do critique it as much as possible. IMPORTANT NOTE: I updated the code at 3:30 3/23 ...
1
vote
0answers
238 views

Basic demonstration of sprite class in pygame

I recently created a general purpose sprite class that allows me to easily create and render sprites to the screen, and test for collisions among other things. That class can be found here. So in ...
2
votes
1answer
218 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
4answers
769 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 ...
5
votes
1answer
474 views

Snake game in Pygame

This is my first game, and looking for some help to improve current code because I've identified a lot that I think could be written more efficiently, particularly the segment that checks which key ...
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() ...
2
votes
1answer
903 views

Tower of Hanoi: graphical representation of optimal solution

I wrote a program to show graphically the solution of the problem of the Tower of Hanoi. Here is a video of an example run. The logic of the solving is taken from StackOverflow (see links in ...
7
votes
1answer
1k views

Wrap a long string to an array of short-enough strings

I have made a function that wraps text in pygame (i.e. it turns a long string into an array of smaller strings that are short enough so they fit within the given width when rendered in the given font)....
10
votes
1answer
1k views

Pokemon battle simulator

I learned Python and Pygame and now have coded a few games. For the last few months I have been working on this "luck free" pokemon battle simulator. I feel my program runs well in the current state ...
7
votes
1answer
346 views

Flappy Bird clone

I am a beginner in Pygame (and programming in general) and tried to make a Flappy Bird game. It works fine, but I'm sure the code has a lot of scope for improvement. It is completely procedural, and ...
2
votes
1answer
793 views

1 player Pong with AI

I have made this pong game as a 1 player game, versus the computer. however it is impossible to beat the ai. Any ideas to make the code better would be appreciated. ...
4
votes
1answer
970 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 ...
2
votes
1answer
681 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 ...
3
votes
1answer
317 views

Pygame Flash Game

I managed to finish this game I am sure you have encountered before. If you run it there are instructions on what to do. Any code suggestions / improvements? ...
6
votes
2answers
3k views

Simple 'Space Invaders' clone

This is my second game, not yet finished but working. I've put so much time into it I wanted to get feedback before continuing. I always learn so much from those that comment. Whilst my first (still ...
2
votes
0answers
47 views

Avoiding multiple hits to Sprite by shifting Sprite to separate group

Would appreciate any suggestions or improvements, I'm sure there are many. Especially so on the way I've avoided multiple hits by the missiles; shifting the asteroid into a separate group to enable ...
8
votes
1answer
323 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 ...
5
votes
1answer
413 views

Snake game school project using Pygame

I am making a snake game and I'm almost done but I want to make my code more organized so people can understand so how to do it. ...
4
votes
1answer
997 views

Pong in Python and Pygame

I'm new to programming. This is my first project where I tried to use object-oriented programming. I'm looking for all kinds of comments. ...
3
votes
1answer
364 views

Drawing a planetary system in Pygame

I am new to programming and mostly self-taught by following a few MOOCs and doing little projects. I have reached the point where I am trying to develop more complicated programs (numerical models at ...
6
votes
3answers
9k views

Beginner grid-based game movement engine

Tell me how I can make it more efficient, shorter. How I can make it adhere more to convention? Is there some stuff I'm doing that you would do in a better way? The main gist is that I create and ...
3
votes
1answer
351 views

GUI Elements for pygame games

I've been making games using the Pygame module recently. I've noticed that Pygame has no builtin GUI elements. To save time for me (and hopefully other people), I have created some very simple GUI ...
2
votes
1answer
1k views

Beginning of a tower defense game, using pygame

I'm currently working on my first project and I have been programming in python for 4 days now. I currently have a dilemma where my code is running too slowly. I don't want you to make a full review, ...
12
votes
2answers
285 views

Using the mouse to avoid asteroids and black holes

I have finished my first project for Python. I would be very grateful if you could check it and give me some feedback. Just simple game with possibility of replay. There are probably lots of mistakes ...
2
votes
2answers
70 views

Text font size adapting to space

In order to practice my programming skills, I am trying to implement a Button class, to use in pygame. I know there are libraries like PGU, I do this to improve in programming. I spent a bit of time ...
3
votes
1answer
1k views

Beginner's pygame Conway's Game of Life

Here's my implementation of Game of Life. I'm quite new to Python and would like to know how could I improve that code, especially in terms of performance, compactness and readability. ...
3
votes
2answers
168 views

Count number of occurrences of each word of text, display as circles of varying size

My focus was to have clean, structured code. It has to be efficient. The display doesn't have to look that good. The circles do overlap and sometimes the word doesn't fit inside the circle, but those ...
8
votes
1answer
1k views

Small Python class for Lindenmayer Systems

L-systems are basically rules for recursively rewriting a string, which can be used to characterize e.g. some fractal and plant growth. I wrote a small class to represent deterministic L-systems and ...
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
7k views

Memory game using Python and PyGame

I am a beginner in Python and PyGame and wrote a memory game. I think there are lot of things I could have done better. I am looking for some advice on how I can improve the design and refactoring of ...
10
votes
1answer
391 views

ChickenDodger game written using Pygame

I just made my first pygame program, ChickenDodger, and I would like to know how I could make my code better. I think I did pretty good for my first time, except the way I added the 2nd egg. I do not ...
3
votes
1answer
348 views

Python 4 Players Snake Game

I would really like to hear out some suggestions as well as general response to the code I've written for 4 players snake game. It's my first time using pygame module, as well as trying to design a ...