Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [pygame]

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

4
votes
1answer
41 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 ...
-1
votes
0answers
22 views

Python pygame moving dots [closed]

I am programming in python 2.7. My code is below. In the main() loop i have a dot being drawn moving in a random direction and keeps changing direction. When the dot dies, it spawns another dot which, ...
32
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 ...
1
vote
1answer
61 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
30 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
154 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
106 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
90 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
38 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
902 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 ...
6
votes
1answer
74 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 ...
4
votes
3answers
702 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 ...
4
votes
1answer
116 views

Python Pygame treasure hunt game

This is a python game that I am working on. It is a grid based treasure hunt game in which you collect coins from specific tiles (some tiles ask you questions in which you need to answer correctly in ...
6
votes
1answer
127 views

First OOP in Python 3: Pygame Pong

I have been studying Python for a few months and just recently decided to stop avoiding OOP and reworked a Pong game to a more object oriented style. Please tell me how I should improve my code. Some ...
2
votes
2answers
80 views

Pygame simulation of a production line

So my code works as intended, but suffers major performance issues every time I add a new object to the screen. The speed of my objects basically gets cut in half. All you have to do to observe this ...
2
votes
3answers
554 views

Pygame maze game

This is my first attempt at python game in pygame. It's a maze game where the maze is randomly generated using Prim's Algorithm. ...
2
votes
1answer
77 views

First Pong game

This is my first pygame project that I've worked on and wanted to start with something simple. Pong was, I think, a pretty good choice now that I'm done with it. I will continue to make improvements ...
4
votes
3answers
651 views

Simple text escape room game

I recently started coding and after learning a bit about functions and basics I tried to make a simple text escape room game. My code is working and the game functions as intended but I now there are ...
3
votes
1answer
92 views

Implementation of Game of Life in pygame

This is my first project in pygame so I am open to suggestions how I can improve my python/pygame skills. I have started programming in python couple of weeks ago and I really want to know what I am ...
1
vote
0answers
28 views

Converting 2D arrays into strings

I have this function which converts a couple of 2D NumPy arrays into strings and then saves them in a text file (grid, quality, <...
4
votes
2answers
188 views

Simple Python Pygame Game

I'm trying to make a simple game for a school project. Do you have any tips on how to simplify and beautify the code? GitHub ...
10
votes
2answers
349 views

Paint program made in PyGame

I am making a paint program in Python using Pygame. Right now the program is very laggy, and I wanted to get my code reviewed incase the reason is in the way I have written the code. EDIT: I was ...
1
vote
1answer
281 views

Implementation of the Snake game in Pygame, with GUI

I wrote a simple Snake game in Pygame, with GUI. It`s my first Pygame game and one of my first projects in Python. My goal with this implementation is to make it bug-free with fluid UI and as fast/...
2
votes
0answers
77 views

Object-oriented model of a machine gun using Pygame

I just started to use classes in Python, so I don't know all concepts, rules and conventions about it. I made a little program of a machine gun, which simulates firing by user's action. Here it is: <...
3
votes
0answers
181 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 ...
1
vote
0answers
58 views

Arabic Language lesson program Part 3

This is the third time I am asking for a review of this code (first time can be found here: Arabic language lesson program and the second can be found here: Arabic language lesson program Part 2). ...
1
vote
0answers
576 views

Text-Based Adventure RPG with PyGame

I'm creating a text-based adventure game using PyGame. I plan on also implementing kind of a Pokemon/Final Fantasy style combat system that works with menus instead of commands, but I haven't started ...
3
votes
1answer
506 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. ...
5
votes
1answer
99 views

Beginnings of a neuron simulation

I have 2 classes that do extremely similar things. The only differences are that they draw using different colors, and that one draws in the back. The classes ...
4
votes
0answers
84 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
113 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
145 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
94 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
343 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
216 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
889 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
204 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
321 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
86 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. ...
6
votes
0answers
208 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
372 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
402 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 ...
3
votes
1answer
132 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
259 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
264 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
2k 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
223 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
69 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
1k 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. ...