Questions tagged [pygame]

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

Filter by
Sorted by
Tagged with
8
votes
0answers
43 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
51 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
26 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 ...
5
votes
1answer
64 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
60 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
50 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
53 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
635 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
47 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
187 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
8k 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
1k 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
31 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 - ...
2
votes
1answer
50 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: ...
3
votes
1answer
41 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
85 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
116 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
76 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
76 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
117 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
402 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
57 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
208 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
77 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
1k 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
127 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
177 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
87 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
167 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
101 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 ...
4
votes
2answers
95 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. ...
63
votes
4answers
44k views

Flappy Bird game clone for a beginners' programming class

I'll soon begin teaching a beginners' programming class. It's voluntary, so I thought I'd make it interesting by teaching Python programming and then introduce the kids to Pygame, so that they can ...
3
votes
2answers
159 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 ...
-2
votes
1answer
510 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: ...
3
votes
1answer
136 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
250 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
541 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 ...
4
votes
1answer
477 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...) ...
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
221 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
378 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. ...
5
votes
1answer
41 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 ...
8
votes
2answers
942 views

Golf game boilerplate

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 going out of bounds. If I do ...
7
votes
1answer
234 views

Plotting terrain pixels with PyGame based on random NumPy array

I am experimenting with Perlin Noise and random map generation. I have a 2D numpy ndarray full of 16-bit floats called map_list that I call from the singleton ...
7
votes
1answer
2k views

Builder - A 2D Minecraft clone

I was poking around on my Raspberry Pi that I hadn't turned on or used in a while, and I stumbled upon this Python script that I wrote ~1.5 years ago, and I was intrigued. Essentially, it's a 2D ...