Questions tagged [pygame]

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

Filter by
Sorted by
Tagged with
4
votes
0answers
31 views

Feedback on 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 ...
1
vote
0answers
41 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
47 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
46 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
186 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
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: ...
4
votes
1answer
71 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
36 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 ...
2
votes
1answer
74 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
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
105 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
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 ...
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 ...
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? ...
1
vote
0answers
165 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
86 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
142 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
87 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
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 ...
4
votes
2answers
92 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
156 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
48 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
132 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
247 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 ...
35
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
503 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
214 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
351 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
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....
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
936 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
229 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 ...
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 ...
4
votes
1answer
255 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
328 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
136 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
1k 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
111 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 ...
5
votes
3answers
2k 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
167 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
37 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, <...
5
votes
2answers
276 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
904 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
389 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
102 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: <...
8
votes
1answer
395 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
88 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). ...
2
votes
0answers
1k 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 ...