A game development library based on the Python programming language. It wraps SDL for easy use alongside Python.

learn more… | top users | synonyms

1
vote
2answers
916 views

Detecting walls or floors in pygame

I am trying to make bullets bounce of walls, but I can't figure out how to correctly do the collision detection. What I am currently doing is iterating through all the solid blocks and if the bullet ...
1
vote
1answer
37 views

Pygame time.get_fps() value

I was looking at the pygame.time.Clock.get_fps() method and after puting it inside of the while loop printing and checking it some times, i see that i starts to give its value after five frames (and ...
0
votes
1answer
47 views

Fast Flood Fill in Pygame?

I am creating a simple game in Pygame for my kids. It involves intersecting random complex curves. Some of the intersections can be coloured in different colours. I have implemented a flood fill ...
0
votes
1answer
134 views

pygame for python 3.5

I am running python 3.5 and I want to install pygame, the website only supports up to version 3.2. I have tried a few forums on this and other websites but they are all for python 3.4. Does anyone ...
0
votes
1answer
117 views

Pygame wall collision is acting very odd

I've been playing around with python for a while, but I only did basic functional programming. Lately, I've been teaching myself about classes. I've been using pygame (instead of tk, because let's ...
0
votes
1answer
66 views

How to use collision masks and overlap_area in pygame?

So, I've been prototyping a game, and I've been using sprite collision, and it's not cutting it any more. I read up on the documentation about masks and overlap area: ...
0
votes
1answer
422 views

Collision in PyGame for spinning rectangular object.touching circles

I'm creating a variation of Pong. One of the differences is that I use a rectangular structure as the object which is being bounced around, and I use circles as paddles. So far, all the collision ...
1
vote
0answers
77 views

Why is my partially transparent image blitted fully opaque?

I have a part in my program that should display the currently playing song's name for the first 4 seconds, then fade out. Even though Surface.get_alpha() returns expected results, the image still does ...
0
votes
0answers
25 views

Pygame image blitting makes game lag

So I have a tile-based game that is 216X384 units large. Each square in the cell_array is grass, which I pre-loaded with convert_alpha(). Each time it draws (I have fps at 30), it cycles through the ...
0
votes
0answers
18 views

Pygame Colorkey works on the image surface but not on the screen

I running pygame on python 3.2.3 and trying to make a pygame 3 Agar clone. I've created simple sprite objects using draw.circle and drawn them to their own surface called image. I've then used ...
0
votes
0answers
32 views

how to increase lenght and make body of snake in pygame

I'm programming a snake game and I'm not sure how increase the length of the snake. Main part of code: lead_x=300 lead_y=300 dirx=right(default) if dirx=='right': lead_x ...
0
votes
0answers
15 views

Spritesheet trouble / code review

http://stackoverflow.com/questions/34563084/spritesheet-trouble-code-review If the player presses right, i have an image of a guy facing right. Left, up, and down same concept. if he holds the ...
0
votes
0answers
34 views

How can I make bullets go to the cursor in Pygame properly

So hey, I'm new into making games and programming at all, I tried to make a small game thingy in Pygame that would include a dude shooting bullets and stuff. However, I can't really get the shooting ...
0
votes
0answers
54 views

Pygame events work in Python2 but not Python3

When I run this code in Python2 it works (to read the keyboard), but in Python3 it doesn't. In Python3, I notice: The game window opens, but it doesn't come to the front. The terminal window stays ...
0
votes
0answers
118 views

My sprites do not always respect collisions in Pygame

I have a Player sprite (40x40 pixels) and Tiles (20x20 pixels) which build the terrain. At the 4 edges there are 2 rows or columns (depends on vertical or horizontal) of wall tiles. Those are the ...