Pygame is a portable Python package for video games, built on SDL.
3
votes
1answer
65 views
Python 4 Players Snake Game
I would really like to hear out some suggestions as well as general response to the code I've written for 4 players snake game. It's my first time using pygame module, as well as trying to design a ...
7
votes
1answer
50 views
Simple top down shooter game
This one of my first Python games in PyGame I decided to make for fun. Basically, you control a from top down perspective and shoot people in a maze.
This is the rewrite of the original code, and I'm ...
1
vote
2answers
46 views
Bricky - A Breakout Clone in Pygame
I've been working on learning Pygame and I made a Breakout clone. I'm looking for stylistic advice and overall suggestions for improvement.
Controls are simple: - ← and → to move.
...
15
votes
3answers
720 views
Setting the scene for a role-playing game
I made some games in Pygame, but I am still new to making games.
I made this RPG game, and this code is just a part of the game. The game executes different Pygame files for different levels of the ...
8
votes
1answer
103 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.
...
5
votes
2answers
142 views
Sample Python game is running slow
I got my game working for so far, however, I would like the game to run faster. It's running at approximately 26 FPS when most of the blocks come in; my FPS goal would be about 60 FPS. How do I fix ...
3
votes
1answer
51 views
A way of keeping a constant game speed at any fps with Pygame
Normally the game speed with pygame is locked with the fps, so I attempted making a simple two classes that'd be super easy to use, to allow for the same game speed no matter what the fps is.
For ...
6
votes
1answer
52 views
Passing two player objects to a class
I am a PyGame newbie and am learning as I go. I would like to become familiar with normal PyGame conventions. I would like you PyGame experts go over my code and let me know if there are any places I ...
1
vote
3answers
140 views
Collision detection algorithm
This is my second algorithm and I will try to make it as simple for you to understand how it works. It is pretty expensive and I'd like to make it more efficient.
.
It works by splitting a square ...
7
votes
1answer
147 views
Pygame version of my 3D Tic Tac Toe/Connect 4
I posted a question a while back asking for some feedback on the code of a game I made (it was limited to typing the input and drawing the output in ASCII).
Now I've got it linked up with pygamef. ...
10
votes
3answers
188 views
Bunny and Badgers: A tower defense game
I made a tower-defense game in Python with Pygame called "Bunny and Badgers". You're a bunny and must kill the badgers before they come into the castles. You can use W, A, S, D and the arrow keys to ...
6
votes
1answer
233 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 ...
4
votes
1answer
102 views
Simple Snake with pygame
I've been reading Dive Into Python and I needed to actually program something before I forget everything I learned. So, this is my first Python project (apart from trying the basics and playing with ...
6
votes
1answer
56 views
Input processing/state machine function
I'm making a Mario clone in pygame and I have just wrote a function proccesses inputs and acts as a state machine for Mario. Everything is working just as I want it, but I was wondering if you can ...
6
votes
1answer
74 views
Game loop decorator for Pygame
I've built a simple decorator that wraps a function in a general Pygame game loop. It also allows for the programmer to set the tick rate.
...
3
votes
1answer
60 views
Class modelling for a shogi notation reader
I have made GPL software in GitHub whose purpose is reading shogi notations (shogi is Japanese chess). I have been told that my software modelling is underdeveloped in this question and advised to ...
10
votes
1answer
145 views
Pong game in Pygame
This is my first time trying OOP and I definitely made many stylistic mistakes. Please tell me how I should improve.
Controls:
w and s for player 1
↑ and ↓ for player 2
The player with higher ...
0
votes
2answers
66 views
Avoiding regexps abuse in generation of statements to be executed
I made a GPL project to read Shogi Western Notations that I made public in GitHub. The project works perfectly on Ubuntu. Please check README.md to check requirements.
All this code works quite well. ...
7
votes
1answer
197 views
Running a version of Space Invaders
I made a program that runs my version of Space Invaders.
I recently finished it. I just want to make it more pythonic, and streamline it so it uses less memory and performs faster.
The basic outline ...
5
votes
1answer
374 views
Snake game made in Python
I made a snake game with /some/ code from thenewboston's tutorials when I had just started Python. I think it wasn't a good idea to start game development right away since I didn't even know if what I ...
3
votes
1answer
106 views
Discoknights game structure
I'm building a game with Pygame, a simple turn-based strategy game where on each turn a character can move and/or perform an action. I have a somewhat good structure for the game on the background, ...
5
votes
3answers
191 views
Pythonic implementation of Conway's Game of Life
I've just finished with my python implementation of Conway's Game of Life. Can I get some opinions on it?
...
9
votes
1answer
199 views
Block_breaker clone in pygame with simple edge detection
I tried to make this clone of
brick_breaker on my own
in one day. The source code and assets .
However I have some concerns about the code so far:
It uses simple edge detection code (as if ball ...
10
votes
3answers
602 views
Souped-up random walk terrain generator
I started learning Python a couple of weeks ago, and to test my new knowledge of Python, I decided to use Pygame to code a random walk terrain generator.
...
1
vote
1answer
552 views
4
votes
1answer
449 views
Pygame menu to launch games - follow up
Follow up of Pygame menu to launch games
I rewrote most of the code per the one answer. I'm looking for further advice to improve to the code. I'm afraid some of the abstraction may be too Java-like. ...
2
votes
1answer
546 views
Pygame menu to launch games
I made a menu to display a list of games and their info so that they can be uniformly launched from an arcade cabinet like set up. I was asked to do it in Python so I learned python using this and ...
40
votes
4answers
12k 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 ...
6
votes
1answer
66 views
Editing Surfaces Removing Color
So I have recently tried to load an image and save it, but remove all of a certain color. I'm running the program and it is running really slow, is there a more efficient way to edit an image? My code ...
0
votes
1answer
534 views
Is this Pygame projectile code efficient?
Just wanted a few opinions on whether this game's code is efficient, from looking at it, it does look a bit all over the place but I just don't know how to 'tidy' it up to say so. Would love to hear ...
6
votes
1answer
469 views
Tetris clone written in Python/Pygame
I have a medium-sized project here, and I would like some comments on the code. In particular I'd like comments on how well I'm handling OO-programming, my programs logic and whether you think my code ...
3
votes
1answer
196 views
Write and control Perlin noise for 1D
I'm reading this tutorial and it's the first time I try something this new.
Here is my attempt:
...
3
votes
2answers
153 views
First Chess Project (ver 1.1)
I'd already asked for my code to be reviewed earlier here
First Chess project)
Full code
Considering the suggestions put forth for that question, I spent a day and refactored my whole code. For ...
10
votes
3answers
392 views
First Chess project
I'd made a project using pygame in python around 3 months ago. This was my first big project after I started learning how to program in college.
Now I'd like to know just how good my programming ...
4
votes
1answer
296 views
Making this Pygame code object-oriented
PYTHON 2.7-
I want to make my code OOP. I also want feedback from you on correctness, tidiness, design patterns and so on.
Here's the download link. It's not permanent but it's the best I have ...
3
votes
1answer
148 views
Virtual sandbox game
I am working on an app: a virtual sandbox of sorts, a lot like Powder Game.
The problem is, when working with an app, you must deal with hardware limitations. Don't get me wrong, the speed isn't like ...
8
votes
2answers
953 views
How can I shorten this paint program?
I am currently in a challenge with my buddy to see who can code a simple paint program in the least lines. The only requirement, is that the program must include an eraser. How can I possibly shorten ...
2
votes
3answers
379 views
SimCity clone with PyGame
I am doing my best to keep this code clean and fast, but as I add more to the game, it seems to get harder to maintain a frame-rate higher than 200! I believe that the culprit is a somewhat large ...
11
votes
2answers
351 views
SimCity clone performance
I am working on a SimCity clone, and I am noticing a drop in frame rate as I add more objects to my map, now this is expected, but, when I fill the whole screen, the game maintains about 300 FPS.
...
1
vote
1answer
622 views
1
vote
1answer
329 views
Pygame using a dict to store objects instead of an array? [closed]
In my pygame game, I build a level by adding a bunch platform objects to an array called instancelist. Then pygame tests for each instance in instancelist and blits it's sprite over it's rect ...
1
vote
1answer
431 views
Pygame snap mouse to grid? [closed]
The game I am working with is a block game. It generates terrain and then allows you to freely mine and place blocks as you wish (sound familiar Cx) BUT! there is a problem. I have a code that snaps ...
4
votes
1answer
220 views
Terrain generator in a PyGame game
In my game, there is a terrain generator subsequently resulting in many instances.
I have implemented this code:
...
2
votes
1answer
670 views
Object Composition
So I have this Pygame 3.3.2 code of 2 classes. I tried to make it as simpler as possible, but ofcourse to show the problems I have with thedesign.
...
1
vote
1answer
147 views
Text class for Pygame
Failing to get a solution to my problem from other people, I got tired of waiting and wrote this (rather rushed) Text class to deal with the text problems I've been having in Pygame. I wanted the text ...
8
votes
1answer
3k views
What about my Pong game?
Just looking for some pointers on how I could improve the code. This is my first game ever and python is my first language so it's bit messy but I'll be happy to explain stuff if needed. I'm kinda ...
3
votes
2answers
104 views
Spawning an alien to chase the player
I have just made a simple script which spawns an alien that chases the player. I want to move as much of the script into functions so as to minimize the amount of code, to make it run better when my ...
5
votes
1answer
3k views
Text-based adventure RPG inventory code
I am trying to make a text-based RPG in Python and Pygame. I need a way to manage my inventory slots. Currently, I have no way to find out what is currently equipped. I can only overwrite it, even ...
3
votes
1answer
1k views
GUI system in PyGame
I'm making a GUI system in Python for game development with PyGame. Right now I have a button that changes colors when you hover and click on it. My question is, is this code well designed or can it ...
11
votes
1answer
23k views
Snake game using PyGame
I wrote a simple Python snake game which is about 250 lines of code. Can someone give me some advice on how I can refactor/make it better?
game.py
...