Tagged Questions
1
vote
1answer
56 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
1answer
45 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
152 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
101 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 ...
1
vote
1answer
95 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
140 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
90 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
174 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
95 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 ...
2
votes
2answers
181 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
0answers
154 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
62 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
62 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.
...
1
vote
2answers
160 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
481 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 ...