Python is a dynamically and strongly typed programming language that encourages readability.

learn more… | top users | synonyms

4
votes
5answers
559 views

Collision detection performance problem

Using python and pygame I've built a collision detection system according to the instructions in this YouTube tutorial. This is updated 40 times per second and controls movement and collision ...
0
votes
1answer
308 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 ...
2
votes
1answer
91 views

Getting an instance of KX_PolygonMaterial in Blender

I've got a question concerning using Python in Blender's Game Engine. Before I start I want to state that I'm trying to change the color of an object in Blender's game engine. To do this, I'm ...
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
145 views

How can I use iteration to lead targets?

In my 2D game, I have stationary AI turrets firing constant speed bullets at moving targets. So far I have used a quadratic solver technique to calculate where the turret should aim in advance of the ...
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) ...
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
402 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
1answer
153 views

Looking for a library to create a grid based first person game online

Before I go and build it myself, I have been looking for a library that may help making a grid based first person view similar to: https://www.youtube.com/watch?v=GwmZoCFd4Us I plan to make a web ...
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 ...
0
votes
1answer
108 views

Read an object from compressed file generated from ActionScript 3 [closed]

I have made a simple game Map Editor and I want to save a array that contain map tile info to a file, as below: var arr:Array = [.....2d tile info in it...]; var ba:ByteArray = new ByteArray(); ...
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 ...
0
votes
1answer
350 views

Python library for scripting (C++ integration)

Please advise me good wrapper/library for python. I need to implement simple scripting in c++ app; Under "good" I mean pretty understandable, well documented, no memory leaking, fast. For creating ...
1
vote
1answer
233 views

Game software design

I have been working on a simple implementation of a card game in object oriented Python/HTML/Javascript and building on the top of Django. At this point the game is in its final stage of development ...
1
vote
0answers
209 views

what space is this Matrix in?

In Blender 2.6 API, PoseBone is used for animating a bone. PoseBone.matrix is one way to do that. API says PoseBone.matrix is in "object space". ...
3
votes
2answers
539 views

Collision library for bullet hell in Python

I am making a bullet hell game in Python and am looking for a suitable collision library, taking the following into consideration: The library should do 2D polygon collision. It should be very fast. ...
5
votes
2answers
849 views

How to render metaballs?

How to render metaballs? I am a Python programmer familiar with the Panda3d and Blender3d APIs. My math kinda sucks, but I know enough to write game logic code and procedural model generation code, ...
1
vote
2answers
321 views

Implementing Online Leaderboards for indie windows PC Game

I've just finished my game and I'd like to add some ranking functionality to it. I have a mySQL database running on my website and want to be able to insert and retrieve data from it. My knowledge in ...
3
votes
5answers
3k views

How do i choose what technology to use for a 2D game like Pokemon? [closed]

I apologize in advance for the wall of text about to come. I've had an idea for a game for a while now, and am stuck at step 1 of game development: Choosing a language/engine. I've read a whole ...
2
votes
3answers
325 views

Publish Python Game

I wrote a Python game in for a group project using Pygame. Now we wanted to package it into an executable but I can't seem to do it. When I was working with C# through Microsoft Visual Studio it had ...
0
votes
2answers
418 views

How to handle multiple game sessions where players turn can timeout, using Python and Socket.IO?

I want to make a multi player card game, allowing several people to play with each other (each game session should be able to have between 5 - 10 players). I'm doing this in Python (Django and ...
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 ...
0
votes
0answers
397 views

Calculating the correct roll from a bone transform matrix

Read this forum topic for more info: http://blenderartists.org/forum/showthread.php?260602-transform-matrix-to-bone-%28head-tail-roll%29-bug I'm trying to get my Blender3d modeller importer to create ...
3
votes
0answers
228 views

Blender - creating bones from transform matrices [closed]

Notice: this is for the Blender 2.5/2.6 API. Back in the old days in the Blender 2.4 API, you could easily create a bone from a transform matrix in your 3d file as EditBones had an attribute named ...
2
votes
2answers
2k views

2D animation example in pyglet (python) looping through 2 images/sprites every x seconds

Suppose you have two images: step1.png and step2.png . Can anyone show me a very simple example in pyglet how to loop through those 2 images say every 0.5 seconds? The character doesn't have to ...
2
votes
1answer
264 views

Scaling window contents in Pyglet?

I'm trying to scale a window's contents so that every pixel displays at a multiple of it's normal size. Basically I want to achieve larger pixels without scaling each and every individual sprite. This ...
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.), ...
1
vote
1answer
2k views

Exporting UV coords from Blender

So I have searched on google and various other websites but I've not found an answer. The only ones I did find did not work. So my question is how do I get UV coords from blender (2.63)? Currently ...
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 ...
1
vote
1answer
206 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 ...
5
votes
2answers
640 views

How do I sync entity ids with the server and client?

I'm continuing my experimentation with entity component design by making a multiplayer space/trading/combat game with python and panda3d. My component system is a simple version of java's artimis. The ...
1
vote
1answer
127 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 ...
16
votes
3answers
2k views

How can I generate random lakes and rivers in my game?

I have a 2D block building game and am trying to make randomly generated lakes and rivers. I have looked into the Perlin noise algorithm, but, I couldn't get it to generate random and nice results. I ...
2
votes
3answers
537 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
256 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 ...
5
votes
2answers
543 views

Web-based micro-transaction API

I am currently making a browser-based game and I would like to integrate micro-transactions. However I would prefer not to have to implement my own storefront. Does anyone know of an available ...
3
votes
2answers
1k views

Python float 32bit to half float 16bit

I'm trying to write a 3D model exporter addon for Blender in Python and need some help. The spec of the 3D format uses some compression on the vertices, there is a vertex buffer that contains ...
0
votes
2answers
750 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 ...
7
votes
1answer
1k views

How do I communicate with an IronPython component in a C#/XNA game?

My XNA game is component-oriented, and has various components for position, physics representation, rendering, etc, all of which extend a base Component class. The player and enemies also have ...
1
vote
1answer
2k 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
2answers
565 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. ...
2
votes
1answer
114 views

Velocity control of the player, why doesn't this work?

I have the following code inside a while True loop: if abs(playerx) < MAXSPEED: if moveLeft: playerx -= 1 if moveRight: playerx += 1 if abs(playery) < MAXSPEED: if ...
1
vote
1answer
577 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
388 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) ...