Questions tagged [pygame]

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

Filter by
Sorted by
Tagged with
1
vote
1answer
22 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
59 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 ...
4
votes
1answer
47 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
44 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
226 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
77 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
56 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
104 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
71 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
168 views

Scan-line algorithm to fill in a triangle

I wrote the following script to fill a Triangle. ...
2
votes
1answer
65 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
97 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
93 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
1answer
130 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
65 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
30 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
86 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
91 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
59 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
64 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
1answer
51 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
1answer
190 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
1answer
35 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
3answers
80 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
1answer
140 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 ...
3
votes
1answer
61 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 ...
1
vote
1answer
118 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 ...
0
votes
1answer
84 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
172 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 ...
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 ...
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 ...
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? ...
1
vote
0answers
233 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
110 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. ...
6
votes
1answer
237 views

Menu with buttons using pygame

I wrote this to teach myself how to make a menu with buttons and I want to know if I've done well and if there's any way to make it shorter and/or more efficient. ...
3
votes
1answer
196 views

A class and a function to create and light up buttons in PyGame

This is my first ever try at making reusable code. The function makes use of two images to give the illusion of turning on and turning off a button in pygame. I would like to know what would you do ...
6
votes
1answer
140 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 ...
4
votes
2answers
98 views

Breakout clone in pygame

As a guy who started coding a month ago, I would like an honest review of my version of breakout that I created using pygame. ...
3
votes
2answers
172 views

Object-oriented cat-and-mouse in Pygame

I'm rather new to programming. So far I've only done some small coding tasks once every now and then, and this the first "bigger" project for me. I love the idea of object-oriented programming and I'...
3
votes
0answers
49 views

How can I make my Pygame Tic Tac Toe game better?

I have this code ready and it works just fine. But what are the ways by which I can improve this code? I have no CS background and this is my first coding project. I could not paste my entire code so ...
3
votes
1answer
147 views

Beginner's snake game in pygame

This is the first big project for me and I am not sure which is the correct way to structure the code yet. Is it okay to have so many classes and functions? What else should I improve? ...
4
votes
1answer
291 views

Gravity simulation using Numpy and Pygame

This is a simple gravity simulator coded in Python 3.7 using Numpy and Pygame. I was wondering if it can be optimized further. Initially I had coded it using pure Python lists, using nested loops to ...
36
votes
5answers
5k views

Beginner's snake game using PyGame

I am a complete beginner when it comes to programming and writing games and this is my first ever game. I made it with python 3 using pygame library. I would ...
2
votes
1answer
661 views

2048 game in Python 3

I wrote this 2048 game using Python 3 and pygame a few weeks ago. Since I'm getting into CS this summer, I would like to get some review on how I can improve my code in generel. Any tips and ...
3
votes
0answers
56 views

Pygame : processing speed independant image loop displayer

I made this in order to teach myself pygame. This displays an images loop at the same speed on any computer (It will lag on a slow computer). Is my time management good or do my datetime call could ...
6
votes
1answer
257 views

Golf Physics “Game”

Continuation of this post 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 ...
1
vote
1answer
517 views

2-Player Tank Battle Game [closed]

I've created a 2-player tank battle game. The code however seems like it could be greatly simplified and there are a few issues. One of which is the hitboxes of the tank seem a bit unreliable. ...
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....
5
votes
1answer
47 views

Locating an image file in a pyGame [closed]

I am writing a simple game with pyGame. Structure-wise, I have separated my game into several files: main.py # the main runner, it loads up the environment ...