Questions tagged [pygame]
Pygame is a portable Python package for video games, built on SDL.
217
questions
4
votes
1
answer
70
views
Weird things to do to an image
Here is a program I wrote to take an image and do weird things to it. Is there any more weird things I can add?
Right now I have:
Chop the image
Flip the image (up/down and left/right)
Rotate the ...
1
vote
0
answers
42
views
Python Sorting Algorithm Visualizer with Pygame
So I've written a Sorting Algorithms Visualizer according to this tutorial, but made some changes and add some features of my own.
The visualization is made with Pygame (Which I never used before).
...
0
votes
0
answers
36
views
Learning UML and OOP, trying to make a game in python. What do you think of this UML diagram?
I'm working on refactoring a simulation that i started writing in python / pygame.
The gist is, there's buildings scattered around a map, and units carry items back and forth from said buildings.
I ...
3
votes
1
answer
67
views
PixelArt made with pygame
I am a bit new to pygame, and I made this simple pixel art game. Is it possible to simplify, and is it possible to save your drawings and load them back again?
...
2
votes
1
answer
86
views
Robotic swarm simulation: aggregation
This program simulates the phenomenon of aggregation of a swarm of robots with no cooperation between each other and each robot following a very simple rule:
The velocity of this robot has a random ...
2
votes
0
answers
25
views
Pygame Rect sorting algorithem
I need to write a program where the user can switch between rect positions.( rects position re-ordering rellevant for activating other functions that not rellevant for this question.)
My algorithm ...
3
votes
1
answer
127
views
15 Puzzle in Pygame
This is a 15 puzzle implemented in pygame. The tiles can be moved with the arrow keys or by clicking and dragging the mouse. Parts of the code that require extra like icons and sound effects files ...
1
vote
1
answer
39
views
When I try to re set up my code after failing in the game I cant get it to run the function without its own file being undefined [closed]
I know my code is ugly and unreadable. I originally had the game working without class functions but when I had to implement class function it all went downhill.
TennisMaster.py
...
2
votes
0
answers
54
views
Connect 4 project for three players with PyGame graphics
I am currently working on a Connect 4 game for a project and it works. We added support so that it can be played by 3 players instead of 2. I know there is multiple instances of repeated code or un-...
2
votes
1
answer
99
views
Invaders clone made with Pygame
This is my first big project that I started after completing the Pygame Shmup guide put together by KidsCanCode. I'm starting to feel like it's very close to being finished so wanted to post my code ...
1
vote
1
answer
88
views
Python MP3 player with pygame.mixer and tkinter for MacOS
I made a Tkinter MP3 Player with Pygame and am looking for tips to improve. Explanation offered in comments in code, but it generally works by getting all the files in a folder. (Have censored ...
3
votes
1
answer
79
views
Pygame program made to look like NohBoard
This is something I made as an input display resembling NohBoard because I need to make a video for a video game, but it's on Linux which doesn't have any good input display programs. One thing I'm ...
1
vote
1
answer
135
views
A simple noise visualizer made using Pygame GUI
I was trying to make a simple noise visualizer using the noise, pygame and pygame_gui ...
12
votes
4
answers
948
views
Gomoku (Connect 5) game implementation in pygame
I attempted to implement a simple Gomoku game (connect 5) in pygame and wanted to get some help. So far, the basic features are working fine with 2 players going against each other.
Entire Code
...
2
votes
0
answers
29
views
One data object instead of array of objects - why is it slower?
I'm currently writing a game of life with small extra features but I ran into a problem - in my first try i decided to use simple list of Cell objects:
...
5
votes
1
answer
108
views
Python's Pygame wrapper
Some time ago, I participated in a Game Jam using Pygame for the first time and I faced a few difficulties with some of its elements, notably the sounds and the events. That's why I decided to create ...
4
votes
1
answer
114
views
class that handles the rpg game map
I created a class to handle maps in my RPG game, before it became a class this was a collection of functions I created, but I thought it could be used as a class. although this code is working but i ...
4
votes
2
answers
167
views
Revised Top-Down Dungeon RPG
Introduction:
So far, the game works well, and my only major concerns, are a bullet system (including a function where you click the mouse to shoot the bullets), and a collision system between the ...
8
votes
5
answers
180
views
Top-Down Dungeon RPG
I'm making a top-down dungeon minigame where you are a knight and can attack zombies by swinging a sword.
So far I haven't implemented collision, player rect(), ...
1
vote
1
answer
49
views
Asking for player name and age using OOP
I have a text adventure game and I need to use OOP so I've chosen to use it when getting the player's name and age. I need to keep the OOP; but was wondering if there are any ways to clean up the code ...
9
votes
2
answers
327
views
Python PacMan with son
I have been coding 'Pac-Man' with my 16yo. A hopefully not too boring project to help improve his Python coding. We have just moved the 'Ghosts' into a class which was a good first introduction to ...
5
votes
2
answers
121
views
Language skill tester using Pygame
I made this little game that tests our language skills. It uses one external module, pinyin, which can be installed via the command prompt command
...
2
votes
0
answers
50
views
A little board game framework with MCTS AI
There are two main classes: Game and MCTSPlayer. The first one is just an abstract class with a couple of methods and some hints ...
1
vote
1
answer
187
views
Little chess game with python
I am pretty sure my code does not follow PEP 8 and would definitely want someone to point out my errors specifically. I am open any form of criticism or suggestions.
...
1
vote
1
answer
33
views
Draw-Your-Own-Cards One-file Memory Match Game
I've made a memory match game, where the users can draw each card.
When the program is ran, there would be a canvas that allows the user to draw in.
When the user is done drawing, they can press ENTER,...
1
vote
0
answers
133
views
Python console pong game - multithreading
I am writing a pong game in Python that uses voice input to move the paddles.
I have implemented multithreading so that the google speech recognition module can always run in a separate thread from ...
3
votes
1
answer
90
views
Snake using Pygame
I'd be grateful if you could review my code. Please be as critical towards it as possible and yet indulgent when it comes to asking my first question here.
This is a simple snake game using pygame. I ...
4
votes
0
answers
70
views
Word finder using pygame
I made a word searching app that allows the user to inout words into a text box,
and parts of the word grid will be highlighted to show the location of the words.
The letters of the grid can be edited ...
4
votes
1
answer
89
views
Water jug puzzle simulation using Pygame
I am making a puzzling tool using Pygame.
We have unlimited containers that we can choose their maximum capacity, and how much water is in them. We can also choose the size of each unit for ...
4
votes
2
answers
245
views
Program Arcade Games: Ch 16 Worksheet 2D-Array Algorithm
The check_celebrity() function below takes an n*n grid as its parameter and prints the celebrity if there is one.
A celebrity is ...
4
votes
1
answer
96
views
Rot13 app - How to tidy up code?
I made a program that lets the user input text into a text box.
The user can choose a number to rotate each alphabetical character by that number,
and the output box will diplay the converted text.
...
4
votes
0
answers
108
views
River crossing puzzle app using Pygame
I am making a river crossing puzzle app using Pygame. Did I implement the conditions optimally?
The Person class arguments for the conditions as to when or not a ...
5
votes
1
answer
185
views
A Python snake game (using Pygame)
So this is a fun little project I am working on. This is my current progress with the game:
...
4
votes
1
answer
438
views
Checking if a value is in the RGB range and then increment/decrement
Is there a better way to check if the variable x is in the 0-255 range and:
if x is less than 255, add ...
5
votes
1
answer
856
views
Scan-line algorithm to fill in a triangle
I wrote the following script to fill a Triangle.
...
2
votes
1
answer
403
views
Tic-tac-toe game using Pygame
I programmed a tic-tac-toe game using pygame. It's the first game I make. I'd really appreaciate any comments you have about the coding style and any improvements that could be made.
...
2
votes
0
answers
439
views
Python code for UNO Game
It's my first time here, so please accept my apologies in advance if something is wrong with my approach to asking.
I've been learning Python for a couple of months and I decided to have a go at a ...
5
votes
2
answers
177
views
Optimizing performance of randomly generated pygame maze game
I made a random maze generator that is also playable. The performance is crap and I'd like to improve it. I'll be working on this for a few more days to make it run better myself, but just thought I'd ...
11
votes
1
answer
158
views
Dungeon Ball, a Pygame
I just completed the first release for my first game on Python, called Dungeon Ball. I'm looking for people to test out the app and give me some feedback and constructive criticism. I'd like to use ...
3
votes
1
answer
79
views
An emotion recognition test I designed using Pygame
for my dissertation (in psychology) I created an emotion recognition test that displays an image of a face displaying a certain emotion for a set time, then allows participants to press a button ...
2
votes
1
answer
86
views
Periodic Table and Simulation of Elements
I've been working on my first real "project" and decided to make the periodic table that can simulate each atom after you press on it. I'm unsure if the code is good and can be used on my ...
4
votes
1
answer
283
views
A Python Snake Game Using Pygame
My attempt at creating a snake game, in pygame. I tried to make it as simple as possible, but i feel it could be better in terms of best practice, and efficiency, along the idea of avoiding redundant ...
5
votes
2
answers
301
views
Pygame Minesweeper Clone
I'm still a relative beginner to coding and I would like some feedback on my Minesweeper clone written in Python using Pygame for the graphics. I'm wondering if it would be beneficial to use classes ...
2
votes
0
answers
138
views
Raycasting python (pyagame)
I want to share my raycasting source (the first engine:)
this program renders the game map (MAP array) and sprites (sprites_on_map array)
ask and criticize!
p.s I don't speak/write English very ...
4
votes
0
answers
78
views
Snake-game using Python 3 and PyGame
I'm pretty new to Python and really new to PyGame. My snake game runs, but I guess that's not really saying much. I would appreciate feedback on the layout, techniques, or best practices of my code.
<...
2
votes
1
answer
57
views
Snake game implemented in PyGame and Python3
I know there's already a whole bunch of similar attempts at this and I've looked at a few of them to get some tips. My main aim with this was not to write anything fancy. I wanted to create a simple ...
8
votes
1
answer
287
views
Clone of mobile game Ballz
I have made a clone of the mobile game Ballz, and it works quite well. However, there are a few problems:
Performance. When I have more than 50 balls in the game, the FPS dips from 60. I am unsure ...
4
votes
1
answer
46
views
Advice on path-finding visualisation program
Im looking for some help on improving my code which visualizes path-finding algorithms. The code is working however I know it can be improved. Any suggestions would be appreciated.
Github code - ...
3
votes
3
answers
104
views
Pygame snake as first game
After poking around in some areas of python, I've decided to try Pygame. After about two hours of coding, this is what I came up with:
...
4
votes
1
answer
613
views
Simple rainfall animation in Pygame
I made the following code. It's a simple animation of 'raindrops' falling and splattering once they reach the ground. The images I use can be found here: https://imgur.com/a/VYV07ef
...