Questions tagged [pygame]

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

Filter by
Sorted by
Tagged with
2
votes
0answers
25 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 ...
-3
votes
0answers
26 views

How to organize and formating my code while maintaining all OOP principles

I want to create a snake game with pygame in python That can fit for multiple players. at the start, i created classes for snake, button and snake-game... Now i want to create an graficall GUI with ...
1
vote
1answer
48 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
1answer
25 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
0answers
67 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
1answer
1k views

Memory Game using Tkinter/Pygame

I'm very new to python and programming in general. For a school assignment, I made this Memory Game and would love to receive feedback from you guys. ...
4
votes
1answer
67 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 ...
5
votes
0answers
46 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 ...
5
votes
1answer
61 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 ...
5
votes
2answers
227 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 ...
5
votes
1answer
78 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
0answers
65 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 ...
6
votes
1answer
116 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
1answer
86 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
1answer
195 views

Scan-line algorithm to fill in a triangle

I wrote the following script to fill a Triangle. ...
2
votes
1answer
132 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
0answers
116 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
2answers
97 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 ...
3
votes
3answers
83 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: ...
11
votes
1answer
132 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
1answer
67 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
1answer
31 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
1answer
121 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
2answers
106 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
0answers
62 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
0answers
65 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. <...
5
votes
1answer
660 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 ...
2
votes
1answer
52 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 ...
6
votes
3answers
7k views

First Python program: Snake

I've started learning Python yesterday with the intention of studying machine learning. Before this, my experience with programming was exclusive to my first semester where I had a C course. I ...
8
votes
1answer
192 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 ...
14
votes
1answer
9k views

Space Shooter made using Pygame

This is my first game made using Pygame of about 550 lines of code. Advice and suggestions are more than welcome. ...
1
vote
0answers
2k views

Card Game using pygame module

I implemented a card game using pygame, the game is a game of war and using png files that I made in Microsoft paint. I tried to keep the object classes as separated from the pygame module as possible....
4
votes
1answer
39 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
1answer
75 views

A simple animation in pygame

I'm following a tutorial into pygame. I realized the example code was written for the sake of being easy to understand. I wondered if I could 'improve' the code, with a focus on keeping the exact same ...
4
votes
1answer
185 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 ...
4
votes
0answers
130 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. ...
1
vote
1answer
133 views

Pong in Python using Pygame

Hi I have written the following code in Python. Any improvements on my code will be appreciated as this is my first shot at pygame! There are some problems in terms of functionality, to state ...
9
votes
1answer
2k views
0
votes
1answer
88 views

Nim in Pygame (Feedback plz)

Hey I am in the process of making this game, please could I get any feedback on how to further approach this, as I find it kind of inefficient. ...
2
votes
1answer
194 views

Asteroids using pygame

I made the looks of asteroids using pygame. I still need to implement collisions but since it is running incredibly slow with 'amount' anything above 10. Please rip ...
8
votes
1answer
444 views

Nibbles/Snake game in Python

I am a total beginner at Python, so I wrote a very simple snake game using pygame to get some practice with it. I also don't have too much experience with object-oriented design. Does the code ...
3
votes
2answers
59 views

Card-'Drafting' Engine

Here is a functional "card-drafting engine" which runs through pygame. It simulates fliping cards face up on the table, and the ability for two players to draft through the cards.There are two ...
2
votes
1answer
241 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 ...
2
votes
0answers
78 views

I want to enhance the memory performance of this game by storing only locations where velocity changes

Please be gentle. I'm a pygame n00b and haven't touched pygame in years. This is my unique implementation of the classic game snake. In this game, the snake has a velocity which can vary along both ...
7
votes
2answers
2k views

Simple PyGame Connect 4

I've made a simple connect 4 game using PyGame. I'm new to python and haven't completely perfected this. I know it's inefficient but I can't tell exactly HOW to fix it? Could someone help me out? ...
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 ...
6
votes
1answer
144 views

Optimizing a raycasting/voxelspace algorithm in Pygame

In the past three days, I've been developing a simple raycasting algorithm. I've made the renderer work as I'd like to. However, it is extremely slow (5 frames per second) because of two things (as ...
1
vote
0answers
287 views

Basic pygame menu with buttons

I'm new to python and newer still to pygame. In my attempt to learn, I set to make a basic menu with buttons. Here's my code: (note, ui_plate, is a system that the buttons are based on, it keeps all ...
3
votes
2answers
117 views

A simple Pygame that has a square move and jump

How does this Pygame code look? Is the run loop usually in a class? I'm a beginner and was wondering what the best format and structure is for using OOP in Pygame. ...