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

learn more… | top users | synonyms

0
votes
3answers
3k 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 ...
0
votes
3answers
441 views

Help me choose an engine [closed]

So far i've been trying to make a RTS in pygame but, i feel like 2d is not enough and pygame has me do a lot of stuff that i would not like doing. What i would like doing is working on the AI gameplay ...
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 ...
0
votes
2answers
178 views

Crossfade Between Two Music Tracks in Pygame

My intention is to have two music tracks, which are similar in nature, fade between each other at various times. When such a fade occurs, one music track should fade from full volume to muted in 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 ...
0
votes
1answer
384 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 ...
0
votes
1answer
65 views

How to spin an object on its own axis?

I'm trying to spin up my own 3D vector graphics engine, so I'd like to do this without an existing library. And I don't seem to be able to find the math for the correct approach in rotating an object ...
0
votes
1answer
531 views

Can you use python, c and c++ in udk without plugins?

Im pretty new to game engines and i was wondering if I could use python, c and c++ in udk. I've tried getting the answer all over the internet but the answers i do find aren't very clear. So am i ...
0
votes
2answers
160 views

Finding vectors with two points

We're are trying to get the direction of a projectile but we can't find out how For example: [1,1] will go SE [1,-1] will go NE [-1,-1] will go NW and [-1,1] will go SW we need an equation of ...
0
votes
1answer
445 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 ...
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: ...
0
votes
1answer
138 views

How to make healthbar size relative to hp

Like in most games with healthbars, the units in my game have a hp_bar object which is a frame, with a slightly smaller rectangle inside which should get smaller (and change color) as a unit loses hp, ...
0
votes
1answer
1k 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 ...
0
votes
3answers
1k views

How to convert .max files to .egg on linux

I am very new to 3d graphics and game engines and panda3d and python. I followed few panda3d tutorials and now I want to test them with few new models. High majority of 3d models in the internet are ...
0
votes
1answer
78 views

Chess Artificial intelligence with python and pygame [closed]

I created chess game with python and pygame. Now I'm trying to make Artificial intelligence, but what is actually best way to do it? Some tips, tricks, links? Thanks
0
votes
2answers
101 views

Best way to store a large amount of game objects and update the ones onscreen

Good afternoon guys! I'm a young beginner game developer working on my first large scale game project and I've run into a situation where I'm not quite sure what the best solution may be (if there is ...
0
votes
1answer
47 views

Bounding Box Collision Glitching Problem (Pygame)

So far the "Bounding Box" method is the only one that I know. It's efficient enough to deal with simple games. Nevertheless, the game I'm developing is not that simple anymore and for that reason, ...
0
votes
1answer
60 views

How to display consistent background image

Drawing a large background is relatively slow in PyGame. In order to avoid drawing BG every frame, you could draw it once, then do nothing. However, if something is overdrawn onto the surface and ...
0
votes
1answer
56 views

WebSockets and Python/PyGame

I am looking to start development on a game that will have the server be written in Python/PyGame and the front end be in HTML5. What I would like to do is, with as minimal impact as possible, open ...
0
votes
1answer
41 views

PyGame2Exe doesn't include spritesheet?

My directory for my Pygame program looks something like this: [Parent directory] lib engine Various .py files graphics spritesheet.py ...
0
votes
1answer
224 views

Texturing a PyOpenGL 3D Cube with PySDL2

So, I've just started learning OpenGL with PySDL2, and I've created a class that will create a cube to the window that I've created with PySDL2. What I'd like to do now, is to figure out a way to ...
0
votes
1answer
163 views

Collision detection without classes, in Pygame

I am writing a game in Pygame and want to get collision detection working. The aim is that when an object hits another, the target object disappears. I want to avoid having classes for now, to keep ...
0
votes
2answers
349 views

Pygame - CollideRect - But How Do They Collide?

I'm having some trouble figuring out how I can handle collisions that are specifically colliding on the top or bottom a rect. How can specify those collisions? Here's a little code snippet to give ...
0
votes
1answer
94 views

Pygame Particle Emitter Problems

so I've been trying to create a basic particle system in pygame which I can later expand upon but I've run into a spot of bother creating the particle emitter. Obviously what's supposed to happen is ...
0
votes
1answer
100 views

PyGame sprite assistance

I've basically just started developing with PyGame and I am having trouble with the whole Sprite concept. I have been looking every where for guides on how to use it, I just can't seem to find any. I ...
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 ...
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
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 ...
0
votes
2answers
749 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 ...
0
votes
2answers
154 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)) ...
0
votes
1answer
478 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 ...
0
votes
1answer
327 views

Importing python DirectX into c++ DirectX program

I'm not asking for code or anything, just some advice on what to google, because I have no idea what to call this process. I made a video player (with full controls) with python and DirectX and would ...
0
votes
0answers
11 views

How to do a code for holding down the down arrow in python [migrated]

Im currently trying to create a script to open a drop down menu, cycle through a list of times, then if a certain image appears, named 'slot available' I would want the program to automatically click ...
0
votes
1answer
38 views

Possible to pass pygame data to memory map block?

I am building a matrix out of addressable pixels and it will be run by a Pi (over the ethernet bus). The matrix will be 75 pixels wide and 20 pixels tall. As a side project, I thought it would be ...
0
votes
0answers
13 views

How do I distribute my game with Py2exe or PyInstaller? [duplicate]

I just developed a game with Python and I want to use Py2exe and Pyinstaller to turn it into a stand-alone python file or .exe that can run on computers without python installed. How can I do this?
0
votes
1answer
32 views

Pygame proble, moving picture

Thats my problem on the Picture...The stripes How can i fix that? My Code: import pygame, sys from pygame.locals import * pygame.init() sound = pygame.mixer.Sound('start.wav') sound.play() size ...
0
votes
0answers
90 views

How to rotate a line in 3d space?

I am trying to figure out direction vectors of the arrowheads of an arrow. Basically I'm given a normalized direction vector (u,v,w) and I need the normalized direction vectors of the its two arrow ...
0
votes
0answers
46 views

How to find the Y coordinate of a line moving up and down with given specific X coordinate?

I start with a horizontal line and I run midpoint displacement algorithm to generate some mountains, then I want to place some pillars on top of the mountain by randomly choosing the X coordinate, but ...
0
votes
1answer
91 views

Player & Level class structure in 2D python console game?

I'm trying to create a 2D console game, where I have a player who can freely move around in a level (~map, but map is a reserved keyword) and interfere with other objects. Levels construct out of ...
0
votes
1answer
110 views

How do I pass an object location into a vertex shader?

I am using Blender Game Engine. I want to create a large flat plane, and deform it locally near a moving object. So far (despite being a beginner at shaders) I've written a vertex shader for the ...
0
votes
1answer
144 views

How does collapsable structures in a voxel based game like Ace of Spades/Build and Shoot work? [duplicate]

I know that once all the cubes that are connected are destroyed, the unconnected blocks collapse. How do you find out the unconnected blocks? edit 1: How would you determine the collapsible object if ...
0
votes
2answers
222 views

Exporting Blender bones' transform matrix

I use this simple python script to export bones transformation: bones = armature.pose.bones # for eaach bone in bones SystemMatrix = Matrix.Scale(-1, 4, Vector((0, 0, 1))) * ...
0
votes
0answers
88 views

Game physics movement

I am trying to write some code in Pygame that will achieve smooth movement from place to another. I've been able to do some nice physics for jumping but when I need to move horizontally I am not sure ...
0
votes
1answer
66 views

How to determine the best approximate direction [duplicate]

I want to determine which sprite to use when one agent is "facing" another agent. My game is 2d, and uses 8-directional movement. Deciding which sprite to use for movement is easy enough since there ...
0
votes
0answers
50 views

How to modify graph ingame?

The pathfinding in my game uses this function to generate a graph: def make_graph(self, size, impassable): nodes = [[astar_gridnode(x, y) for y in range(size)] for x in range(size)] graph = ...
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 ...
0
votes
1answer
183 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 ...
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(); ...
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 ...
0
votes
0answers
396 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 ...