Game development software based on the Python programming language.
2
votes
3answers
255 views
Complex collisions in pygame
I've seen many tutorials for simple rectangle or circle-based collision detection with pygame.
But how can I do more complex collisions with arbitrary polygons?
Is the only option pixel-based ...
2
votes
2answers
294 views
Detecting Units on a Grid
I am making a little turn based strategy game in pygame, that uses a grid system as the main map to hold all the characters and the map layout. (Similar to Fire Emblem, or Advance Wars)
I am trying ...
1
vote
1answer
242 views
Implementing powerups for my Breakout clone
I'm making a simple Breakout clone in Python that will have very many powerups/powerdowns (so far I came up with 26). Some will affect the paddle (paddle missile, two paddles, short paddle, etc.), ...
3
votes
1answer
131 views
pygame.Rect around circle
I'm trying to make a pong game in pygame, but I can't figure out how to put a ball circle, which I can create with pygame.draw.circle into a pygame.Rect object so i can use the colliderect function to ...
1
vote
1answer
156 views
Pixelated and incomplete image when loading with pygame.image.load
This is the image I'm trying to load on the surface, an 40x40 Ubuntu logo:
Ans this is how it looks when trying to show the image on the surface via the blit method:
I'm trying to load different ...
1
vote
1answer
116 views
Drawing over objects occasionally leaving relics behind
I'm drawing a large number of bouncing shapes similar to an old 1990s screensaver. I'm just doing this to study (but not hopework) For some reason my object clearing (simply blitting a black shape ...
2
votes
2answers
242 views
Pygame window becomes unresponsive when I click it
I'm new to programming, python and pygame. This is some code I wrote to draw random colored rectangles on an 800 x 600 canvas. It does what I expected it to do but becomes unresponsive if I click ...
1
vote
2answers
219 views
How to detect whether or not a tile is occupied?
I'm using Python 2.7 on Win7x64 with PyGame
What is the best way to iterate over all the tiles in the game or screen, efficienty? Ideally I have about 800 tiles, but that is a dynamic number I've ...
0
votes
2answers
406 views
Detecting if line crosses rectangle in python. Need speed boost
I am currently writing a top down man vs robot shooter. The game works now, but if I have a decent sized level it runs slowly when you are being chased by robots. While just roaming around it can go ...
6
votes
3answers
568 views
PyGame QIX clone, filling areas
I'm playing around with PyGame.
Now I'm trying to implement a QIX clone.
I have my game loop, and I can move the player (cursor) on the screen.
In QIX, the movment of the player leaves a trace ...
4
votes
1answer
192 views
What is the proper way to maintain the angle of a gun mounted on a car?
So I am making a simple game. I want to put a gun on top of a car. I want to be able to control the angle of the gun. Basically it can go forward all the way so that it is parallel to the ground ...
1
vote
1answer
720 views
How can a pygame image be colored?
How can I color a Pygame image surface? I either want to change every pixel that is color A into color B, or else change every pixel into color B. Either works, so long as transparent regions remain ...
1
vote
1answer
369 views
Bullet physics in python and pygame
I am programming a 2D sidescroller in python and pygame and am having trouble making a bullet go farther than just farther than the player. The bullet travels straight to the ground after i fire it. ...
1
vote
1answer
412 views
Python/PyGame mixer.music playback of OGG file has intermittent clicking sound - how to proceed?
I have a class within my python + pygame game that handles sound - it worked well until I tried use pygame.mixer.music to switch between streaming .ogg music files. The class switches between them on ...
1
vote
1answer
302 views
OpenGL: Rotating cannon about non-centre position?
So I have a "cannon" object (basically a long cylinder) and I want to be able to control its angle. The code I have now is:
glPushMatrix()
glTranslatef(self.position.x,2.5,self.position.z)
...
0
votes
1answer
870 views
Pygame import error [closed]
When I installed pygame and tried to run import pygame, I got this error:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File ...
6
votes
1answer
1k views
Doing an SNES Mode 7 (affine transform) effect in pygame
Is there such a thing as a short answer on how to do a Mode 7 / mario kart type effect in pygame?
I have googled extensively, all the docs I can come up with are dozens of pages in other languages ...
4
votes
2answers
374 views
Using Python what is the best way to perform heavy tasks in the background?
I'm generating large amounts of procedural map data on the fly, however my game engine doesn't rely on them to render the scene and I'd like to build it on in the background and pop it into the world ...
2
votes
2answers
691 views
PyGame custom isometric engine : caching or not?
Sorry if this question about is a bit broad.
In the game I'm making, I need an isometric view with some altitude, which means players can go behind a hill, and be partly or totally hidden. To avoid ...
1
vote
1answer
405 views
Fatal Python error: (pygame parachute) Segmentation Fault when using PyGame and cx_Freeze
I'm using cx_Freeze to package my PyGame game. I'm running Ubuntu Linux, so I used the source package. However, I got the following error when I run cxfreeze game.py:
Fatal Python error: (pygame ...
0
votes
2answers
140 views
Spritegroups and colorkeys
I have a problem using spritegroups in pygame. In my situation I have 2 spritegroups, one for humans, one for "infected". A human is represented by a blue circle:
image = pygame.Surface((32,32))
...
-2
votes
1answer
96 views
Imports in python [closed]
Recently I downloaded a game off pydev and the imports for it look like this below.
import pygame
from pygame.locals import *
However I have only ever created games by calling the in this way.
...
3
votes
4answers
353 views
When connecting a physics engine to another engine, should you do all your logic in the units used by the physics side or the rendering side
I'm currently intergrating pygame and pyBox2D, and am wondering which side is best to try to keep to in terms of game units of size.
Box2D is Meters
PyGame is Pixels
At the moment I am thinking I ...
1
vote
1answer
235 views
How to debug easily an 2D arcade game?
I am trying to learn pygame.
In order to do that, I have downloaded one of their examples :
http://rpg-world.googlecode.com/files/rpg-world-src-0.93.tar.gz
And started to run it in debug mode.
...
1
vote
2answers
331 views
Pygame circular cropping/masks
I have been going through the documentation and the Pygame functions and classes today, but couldn't find a reasonable way to either create a circular crop of an image or how to use a mask to perform ...
1
vote
1answer
908 views
Pygame water ripple effect
I have Googled for it but there are no ready scripts - as opposed to the same effect on Flash. I have checked the algorithm on The Water Effect Explained and also tested an implementation of the ...
13
votes
3answers
2k views
What is a good algorithm for fractal-based procedural city layout?
Background
I run a minecraft server where I'm going to design a starter city of fairly large scale. I have a series of things, like rule signs and mob cages, I would like to put in buildings there. ...
6
votes
4answers
5k views
Which language and tools should I choose for creating 2D games? [closed]
Recently I have returned to my childhood hobby (programming games) and found it quite enjoyable. I've been tinkering with PyGame (for Python) for a few months, made a couple of projects for ...
7
votes
2answers
1k views
Increase blitting speed?
I'm working on a 2d sidescroller in PyGame. For each map we use one texture (this is the actual size of the texture):
Then we load the image with this code:
sprite = ...
0
votes
1answer
416 views
python for game development [duplicate]
Possible Duplicate:
Famous games written in Python
Is python any good for game development? Can I have some examples of great indie python games.
So I can have an idea what it's capable ...
3
votes
4answers
215 views
What can be a game-play element in a game with Shakespeare's plays as the main theme?
I was thinking of learning about making games, so I thought of an idea about making a game on a play, since the content is already there. I actually found well parsed XMLs of Shakespeare's plays. I ...
0
votes
3answers
472 views
Basic developing in python? [closed]
I have basic experience in Python, and I want to know which is the best library to use in development. I was looking originally at Pygame but found it a bit lacking in tutorials. Are there any good ...
1
vote
2answers
284 views
Secondary monitor freezes game window
I was bored and dragging my game window around the screen and noticed something interesting.
When I drag my game window over to my secondary monitor, the screen updating just completely freezes.
Is ...
4
votes
1answer
588 views
Issue with implemented Minesweeper algorithm
So I'm attempting to learn Python by way of Minesweeper. I've got experience with SDL, so I figured playing around with PyGame sounded like a fun way to learn the syntax of the language.
Anywho, I'm ...
5
votes
1answer
483 views
Separating Sprites from Models with PyGame
So I'm trying to code a game using the Model-View-Controller pattern, and therefore have a need to separate the models for my game objects with their sprite representations. The problem that I'm ...
0
votes
1answer
287 views
Batch blit vs separate blit
A tutorial that I have followed had me collect and blit all of my sprites with the following lines:
allsprites = pygame.sprite.RenderPlain((l_sprites))
allsprites.draw()
At the moment, this is fine ...
3
votes
3answers
473 views
Problem in blitting a clean, crisp sprite
I am having a bit of a tooling problem...and I am unsure of how to solve it.
I am currently using PyGame to try and write a simple Minesweeper clone, except my sprites that I made are hexagon based ...
2
votes
2answers
4k views
Pygame How To Use Collision?
Can someone tell me how to implement collision in Pygame?
For example I have a sprite called A and another one called B.
How do I detect if they collide in Pygame?
9
votes
2answers
581 views
Common pattern to scale “real units” to pixels?
This is a follow-up question to this other one.
I would like to know if there is a common/typical/best pattern to scale my representation of the world (currently 160Kmx160Km) to fit it to the drawing ...
0
votes
4answers
788 views
When should I learn Pygame?
I've been learning python for about 2 months now. I think I'm getting used to the language. My question is, when should I start learning Pygame? Or how do I know if I'm ready for it? I'm learning ...
0
votes
2answers
358 views
sprite group doesn't support indexing
I have a sprite group created with pygame.sprite.Group() (and add sprites to it with the add method)
How would I retrieve the nth sprite in this group?
Code like this does not work:
mygroup = ...
1
vote
2answers
230 views
shuffle a sprite group
Is there a way to shufle a group of sprites created with:
pygame.sprite.Group()
I have tried using random.shuffle but it apparently doesn't work on sprite groups.
5
votes
2answers
659 views
How to write reuseable components for pygame
Is there a recommended way to write reuseable components for pygame? Simple example would be a FPS counter. Should I write a class which has an init, update and draw method and call them from inside a ...
2
votes
2answers
682 views
Problems moving a rectangle in Pygame
I'm making a game in Pygame and I want to be able to target enemy unit.
I made it so when I click on them a variable "targeted" becomes true, and stays true until I click somewhere else on the screen. ...
3
votes
3answers
738 views
What are the usual tools for importing models and animations?
I'm a total noob with regard to game programming (though not a noob to programming) and I'm using pygame + opengl to do some experiments with a little game I've been thinking of.
I've been trying to ...
-1
votes
3answers
2k views
Will I have an easier time learning OpenGL in Pygame or Pyglet? (NeHe tutorials downloaded)
I'm looking between PyGame and Pyglet, Pyglet seems to be somewhat newer and more Pythony, but it's last release according to Wikipedia is January '10. PyGame seems to have more documentation, more ...
5
votes
5answers
1k views
Are there any good UI widget toolkits for Pygame? [closed]
Are there any good, modern widget toolkits for Pygame? I've looked at PGU, but it's apparently unmaintained.
4
votes
8answers
5k views
Alternative to pyGame? [closed]
i'm learning something about game programming from a book about "pyGame". pyGame is simple, but... python is a little complex and different from my previous knoweledge about programming.
I know ...
2
votes
2answers
385 views
Help making a visual transition with pygame and NumPy
Perhaps this could be better answered on Stack Overflow, but I thought it would be worth posting here. Right now I'm trying to make visual transitions with pygame's surfarray module which uses NumPy. ...
9
votes
6answers
3k views
Make pygame's frame rate faster
By profiling my game, I see that the vast majority of the execution time of my hobby game is between the blit and the flip calls. Currently, it's only running at around 13fps. My video card is fairly ...