Questions tagged [pygame]

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

Filter by
Sorted by
Tagged with
4
votes
0answers
114 views

Mouse Click Controlled Meteor Avoidance Game

Ongoing development of game. The player is controlled by mouse click to move upward. The goal is to avoid meteors for as long as possible. I would be grateful if someone could critique my code. ...
2
votes
1answer
197 views

The start of a game in pygame, blitting images to the screen

The small bit of code below blits and image to the screen within a class. I call this 4 times to display the image 4 times, each image has a different y coordinate and doesn't need different x but ...
6
votes
1answer
181 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 ...
2
votes
1answer
122 views

ball-game created in Python 3

This is a very simple ball game in which we have to avoid projectiles falling from the sky. This is my second project and first game. Please review and tell where I can improve. ...
5
votes
1answer
666 views

Simon memory game in pygame

I've been teaching myself python and I decided to make a Simon copy. Please let me know if there's anything notable that I should improve on. I understand my use of globals in some functions is ...
4
votes
1answer
319 views

Movement function for a Sokoban game using Python [closed]

I've been working on the functions that handle when a player's sprite interacts with either a wall (0) or say the crate to push (£) I'm just wondering how this looks and if there alternative methods, ...
3
votes
1answer
1k views

Server and client for pong game

This is a pong style game which is very basic but involves sending and receiving data using TCP. The data is encoded using pickle which seems to be very inefficient yet I am still using it. The ...
5
votes
1answer
276 views

Conway's game of life in pygame

I've made a game of life in pygame. I need it to get it to run as fast as possible. I've done everything I can think of. ...
2
votes
0answers
42 views

Checking surrounding pixels inefficiently in pygame [closed]

This checks surrounding pixels to my object's pixel: ...
-2
votes
1answer
496 views

Get list of surrounding pixels of a pixel in pygame [closed]

I am doing some pixel operations in Python, which obviously uses a lot of processing power and makes the program extremely slow. I have these nested loops: ...
4
votes
1answer
88 views

Using Pythagoras' Theorem to Check Point Distance [closed]

I want to procedurally generate several points on a graph that are suitably distant from each-other. These points are meant to represent castles that are part of towns in the world-map of my game. ...
5
votes
0answers
389 views

Game involving catching falling items

This is my first game. Everything in the game was created by me during this week - from assets, music and, of course, code. As I am new to Python I have wondered if the design template for this game ...
4
votes
1answer
472 views

Mars Lander pygame

Here is my code about our final project in uni called 'Mars Lander'. The thing is that my code seems to be all over the place (more specifically in the 'main' function at the end of the code...) ...
14
votes
2answers
413 views

Counting people inside the house game

This program animates people going inside and outside of a house, the user has to keep a running sum in their head and must give the answer at the end. The speed of people, the number of maximum ...
2
votes
1answer
165 views

2D Basic 'evade the enemy' type game

I'm trying to learn how to become a good programmer. I think this means making my code more readable for others. I would really appreciate any feedback whatsoever. I'm not quite sure what specifically ...
8
votes
1answer
521 views

Animation of linear transformations

Coordinates Given a 2d space, we can fix a coordinate system to talk about transformations numerically. The red vector, that ends at (1, 0) and the green vector that ends at (0, 1) are called the ...
6
votes
1answer
289 views

Python implementation of Conway's Game of life with Pygame

So I've started learning programming a few months ago and this is one of my first projects. The program works, but I feel like it's a bit slow compared to the other implementations of Conway's Game of ...
4
votes
1answer
3k views

Snake Game on pygame

I'm working for a month or so on a Snake game in Python. It's working well (I got some good help on it already), but since I'm a beginner in pygame, I would like some feedback from better programmers ...
5
votes
1answer
353 views

Trigonometry Circle representation using Python and Pygame

I wrote this code using Python 3.5 and Pygame to help me learn more about sine waves. Its goal is to show the variations in the sine and cosine values in the Trigonometry Circle as the distance ...
1
vote
1answer
82 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
2k 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
540 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
340 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
6k 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
2k 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
2k 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
103 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
192 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
426 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
670 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
445 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
2k 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
1k 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
386 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
5k 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
334 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
201 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
274 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
287 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
952 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
624 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
1k 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
2k 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
443 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
1k 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
1k 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
849 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 ...