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

learn more… | top users | synonyms

1
vote
2answers
303 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
342 views

How can I load .obj files in the Soya3D engine?

I recently just found soya3d. I want to import .obj files, but it seems to only accept .data files. How can I import .obj files? Importing a .obj file named "house" produces this error: Traceback ...
0
votes
1answer
29 views

Pygame Surfaces: which (and when) do I need to .convert()?

I'm a bit puzzled about pygame's Surface.convert(): It's common sense that I should convert a surface after loading an image to it (presumably a jpg/png/etc file), but what about surfaces that I ...
0
votes
1answer
110 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
118 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
439 views

How do I use setFilmSize in panda3d to achieve the correct view?

I'm working with Panda3d and recently switched my game to isometric rendering. I moved the virtual camera accordingly and set an orthographic lens. Then I implemented the classes "Map" and "Canvas". ...
-2
votes
1answer
78 views

theory behind rotation of a 3d cube using mouse

I want to rotate a 3d cube using mouse in python/pygame. Could someone explain the theory behind rotating a 3d cube by mouse? I dont understand how angleX, angleY and angleZ are affected by mouse ...
1
vote
0answers
37 views

Pygame's sprite.collide_circle() missing several frames of head-on collision

I've spent hours trying to figure why my collision detection was so crappy, with sprites visibly ovellaping for several frames, when I noticed the culprit could be pygame's detection callback ...
1
vote
0answers
84 views

Speeding up point-in-polygon for Python

In researching collision detection methods for non-Rect-like objects I came across point-in-polygon -- specifically, the even-odd rule. The one presently on Wikipedia claims it is written in Python, ...
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 ...
1
vote
0answers
210 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". ...
0
votes
0answers
95 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
0answers
89 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
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
0answers
413 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 ...