Game development software based on the Python programming language.

learn more… | top users | synonyms

1
vote
2answers
2k views

Installing the right version of PyGame

I've been trying to install PyGame for Python, and can't seem to get Python to recognize that it's there. I use Python 3.3, and have a 64-bit Windows computer, but that's really all I know. The ...
0
votes
1answer
446 views

Pygame top down shooter firing bullets

I'm working on a top down shooter in pygame and am having trouble getting bullets to fire. I'm using a class for the bullets, I'll show what I think is the relevant code. This is what I do after the ...
3
votes
1answer
100 views

How to make a map surface object

I'm making a 2d tile based game. In pygame I could create a map like this: screen = pygame.display(resolution) map = pygame.Surface(width, height) for tile in all_tiles: map.blit(tile) ...
1
vote
1answer
429 views

pygame performance issues

I'm trying to make a tactics game using python and the infamous pygame library. I use threading for networking and pathfinding. The game uses a p2p lockstep architecture, with one of the players ...
3
votes
1answer
305 views

Pygame: circular motion with Bresenham's algorithm

I'm trying to figure out a way to move an object in a circular path. I read about Bresenham's circle algorithm, but all the codes available online draw an entire circle. For my game, I want it so ...
0
votes
3answers
339 views

Python mini RPG enemy movement. (how to have two infinite loops running at the same time)

I have a problem with my RPG. I want enemies to wander randomly. So I put: enx_speed = random.randint(-2, 2) eny_speed = random.randint(-2, 2) in the main loop (while true:). However, that loops ...
0
votes
1answer
232 views

Pong pygame problem

I've been following a tutorial to make my first Pong clone. Here is the tutorial: http://muagames.com/tutorials/pygame-3-pong/pygame-3-pong-step-1/ When I try to run it I get this error message: ...
1
vote
1answer
354 views

How do I determine if one value is within a certain range of another in Python

I've been working on the attacking in my RPG. The problem I have recently encountered is, I have to be in Exactly the same x coordinate as the Enemy. When I want to attack the enemy this is what ...
2
votes
4answers
1k views

RPG movement holding down button

I've been writing a simple top down mini RPG in python. My problem is that when I move the player I have to repeatedly tap the arrow key. Each time I tap the key the player moves 5 PX in the ...
-1
votes
1answer
281 views

Flixel or Pygame for a small game? [closed]

I have some experience in Bash and Python, Lua. I've always wanted to try and make point & click quest games. Most quest games I loved aesthetically and gameplay wise were made with Flash. So ...
1
vote
3answers
597 views

Solving the riddle on distributing a python built game?

So, I've done the research, and i've done the try/catch process of almost getting things to work. . . almost. I've read this chart: ...
0
votes
1answer
133 views

Pygame Bounding Box at Player Feet

I'm new to python and pygame and am trying to build a very simple "game" (it's more of a test for me to figure things out) in which you move a character around the screen and he can collide with walls ...
1
vote
3answers
179 views

Geometry problem for area of sight

My player have a line of sight and all objects between the white lines, turns red. To compute this, the following conditions are met: if the angle between the yellow line and the red line are small ...
5
votes
2answers
160 views

Pygame fails on KEYDOWN with Russian keyboard layout

When I press a keyboard button on a keyboard with a Russian layout, my application pygame game crashes with this message: UnicodeEncodeError: 'ascii' codec can't encode character '\u0444' in ...
0
votes
1answer
256 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 ...
3
votes
1answer
174 views

Pathfiding for groups of agents

How can we refine this path search method to make group movement more elegant? I'm trying to make a RTS-style game, using a 2d tiled gameworld. I have implemented an A* pathfinding algorithm which ...
1
vote
1answer
1k views

Pygame 2D Scrolling Map

I have currently a pygame program that stores tiles in a 2d list like [[1,1,1] [1,1,1] [1,1,1]] where the 1 is a tile object. I have the character centered in the middle of the screen, and I am ...
1
vote
2answers
271 views

How to implement rectangle selection?

I don't know if there is another term for it, but I mean this: You hold down a mouse button. A rectangle forms when you move the mouse around. The units inside the box get selected when you let go of ...
0
votes
3answers
2k views

smooth movement pygame

Hello im trying to learn more about smoother movement in games. I have created a little program to hopefully help me understand this. As far as i can tell i am suppose to track time, and update ...
2
votes
1answer
324 views

How do I support animation with frames of different sizes?

I'm trying to create a simple top-view 2D rpg, in the style of Zelda and Secret of Mana, using PyGame. I've managed to make the beginnings of a game, with an animated character walking around. ...
1
vote
2answers
362 views

Pygame's rotation methods have crippling issues, but is it me or Python's pygame?

http://www.youtube.com/watch?v=lNJFxvR6ex8&feature=youtu.be On rotate and rotozoom, can't find fixes on these on the internet, anywhere. Basically, the video is showing 4 things in this order: 1. ...
4
votes
2answers
996 views

Pygame set_colorkey transparency issues

I'm having a strange issue that I cannot seem to remedy. I am doing some prototyping with Pygame on a desktop running windows and a laptop running OS X. Both are running python v2.7.3 (installed via ...
1
vote
1answer
105 views

When to use pygame.sprite.GroupSingle?

I'm doing a game in which i have a ball which is controlled by the keyboard and the goal is to get is out of a maze without touching the walls. I've added my ball sprite to GroupSprite vehicle = ...
3
votes
1answer
396 views

Meaning of offset in pygame Mask.overlap methods

I have a situation in which two rectangles collide, and I have to detect how much did they collide so so I can redraw the objects in a way that they are only touching each others edges. It's a ...
0
votes
2answers
159 views

How do I implement unit selection in this program?

I'm trying to implement unit selection on a large, scrollable surface. # Arbitrary values for window size self.w, self.h = 1600, 900 # Game world surface, everything gets blitted to this, which is ...
3
votes
1answer
351 views

Pygame performance issue for many images

I've made a script for generating a game world based off of image pixel data. Trying to make a python map editor My progress so far has resulted in a program which loads an image and draws sprites ...
0
votes
1answer
307 views

Trying to make a python map editor

The program is supposed to read the pixel color values from an image, and use that data as a map for where to place objects in a game world. Getting the color values was easy enough: import numpy ...
1
vote
1answer
288 views

Pygame - Change sprite collision Rect

I'm making a platformer in Pygame. One of the sprites I'm using is a flag, and I want to detect if the player collides with the flagpole (just like in Super Mario Bros). The problem is that the image ...
1
vote
0answers
68 views

pygame App stops when playing OGG files after building with cx_Freeze

I've built a sample game using pygame and wanted to mess around with packaging it up. I found cx_Freeze which seems to do the trick, except for when it comes to playing OGG files. If I run the app ...
3
votes
2answers
936 views

Pygame surfaces and their Rects

I am trying to understand how pygame surfaces work. I am confused about Rect position of Surface object. If I try blit surface on screen at some position then Surface is drawn at right position, but ...
2
votes
2answers
497 views

How do I detect multiple sprite collisions when there are >10 sprites?

I making a small program to animate the astar algorithm. If you look at the image, there are lots of yellow cars moving around. Those can collide at any moment, could be just one or all of them could ...
1
vote
3answers
232 views

Multithreading for a mixed-genre game in Python?

So here's the situation. I'm making a game that mixes two genres; arcade shooter and puzzler. They don't intertwine TOO much; all the interaction that really goes on is that every time an enemy is ...
0
votes
1answer
142 views

add collision detection to sprite?

bassically im trying to add collision detection to the sprite below, using the following: self.rect = bounds_rect collide = pygame.sprite.spritecollide(self, wall_list, False) ...
2
votes
3answers
2k views

Pygame surface rotation, rect rotation or sprite rotation?

i seem to have a conceptual misunderstanding of the surface and rect object in pygame. I currently observe these objects this way: Surface Just the loaded image rect the 'hard' representation ...
2
votes
2answers
273 views

Grouping surfaces in pygame to get an object with two movement points

I would like to create a simple tank using pygame. One would drive the tank by controlling he velocities of two caterpillar tracks. They should be the two single movement points of the vehicle. I'm ...
0
votes
1answer
184 views

Using NumPy arrays as 2D mathematical vectors?

Right now I'm using lists as position, velocity, and acceleration vectors in my game. Is that a better option than using NumPy's arrays (not the standard library's) as vectors (with float data ...
-1
votes
2answers
400 views

Online scoreboard in Python?

So my friend and I are working on an arcade-style game in Python and Pygame. We're beginning to look at the feasibility of an online leaderboard, given our current programming backgrounds. Such a ...
1
vote
3answers
421 views

How can I make smoother upwards/downwards controls in pygame?

This is a loop I use to interpret key events in a python game. # Event Loop for event in pygame.event.get(): if event.type == QUIT: pygame.quit() sys.exit() if event.type == ...
2
votes
1answer
527 views

Pygame Tile Based Character movement speed

Thanks for taking the time to read this. Right now I'm making a really basic tile based game. The map is a large amount of 16x16 tiles, and the character image is 16x16 as well. My character has its ...
1
vote
1answer
474 views

Pygame Import Error, Python 3.2

I'm having an issue with the Pygame module. I run Python 3.2 and installed the respective Pygame file, but now when I try to import it in the IDLE, it gives me this error: >>> import pygame ...
3
votes
1answer
187 views

How do I create a selection rectangle?

I have a basic prototype working with health, resources and units. The problem is: How do I select multiple units? I have an idea of making an rectangle which dynamically extends with the mouse ...
1
vote
2answers
269 views

what is the best way to use loops to detect events while the main loop is running?

I am making an "game" that has pathfinding using pygame. I am using Astar algo. I have a main loop which draws the whole map. In the loop I check for events. If user press "enter" or "space", random ...
1
vote
1answer
268 views

Embedding Pygame to C++ [closed]

If embedding Pygame to C++ to have a game be an executable, is there any extra process I would have to use in order to use Pygame functions when embedding into C++? As opposed to just writing ...
3
votes
1answer
170 views

Find out what word you are hovering mouse over

I want to be able to pop up something when the user hovers over particular words that are on a label in pygame. Can anyone give me a good (or even bad) idea on how to implement this (doesn't have to ...
1
vote
1answer
2k views

How do I match and clear sequences 3 adjacent coloured blocks?

I'm making a game with elements of a match-3 puzzler (such as Columns, Bejeweled or Tetris Attack). I don't know where to begin creating an efficient algorithm for matching and clearing. My ...
2
votes
1answer
394 views

Blending colors on Surfaces in PyGame?

So I'm making a game in Python and PyGame. I have aliens and blocks that each adopt one of several colors; rather than make several copies of them in different colors, I plan on making the sprite ...
2
votes
3answers
443 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
3answers
424 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
415 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
184 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 ...