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

learn more… | top users | synonyms

0
votes
0answers
61 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 ...
1
vote
1answer
40 views

When is messaging/observing preferable to 'built-in' functionality in game objects?

In working on a Python/Pygame project I recently came to an impasse which couldn't be solved elegantly via my previous methodology - using wrapping functions as an Observer pattern - and it was ...
0
votes
0answers
39 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
30 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
33 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 ...
1
vote
1answer
38 views

Midpoint Displacement 1D - How to properly reduce my random number range?

So I'm trying to implement this http://www.gameprogrammer.com/fractal.html#midpoint algorithm, to generate myself a terrain. In the tutorial is said: OK, before we go into 2D fractal surfaces, you ...
0
votes
1answer
45 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 ...
1
vote
0answers
66 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, ...
0
votes
1answer
63 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
63 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 ...
2
votes
1answer
108 views

Picking random monster cards from a deck

What is the best way to go about making user defined classes (monsters, items, loot, armor, weapons, spell types, etc) and then calling them later during an encounter? Looking at the entire card list ...
2
votes
1answer
55 views

Get a random vector

I'm trying to make a small pariticle-like simulation, and I'm trying to make each parrticle go a random direction from one point (mouse pos). The problem is I don't know how to get the random vector ...
3
votes
1answer
77 views

Pygame collision detection less frequent when objects are increased

I currently experiencing an issue in pygame where whenever i increase the number of objects e.g. platforms, rocks for a in range(150): rock = Rock(0,0) OR incresing the range which they spawn ...
0
votes
0answers
28 views

Generating map in a numpy matrix

I created object, that with random selects which type of terrain is and which weather it has. That is fine for just one place, but now I want to make it bigger and create a map. I create a matrix with ...
0
votes
1answer
139 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 ...
3
votes
1answer
102 views

Directional, Triangular Collision Detection in Pygame [duplicate]

I am trying to create a game in Pygame, with Python 3, and am trying to figure out an algorithm that will tell me which direction a rectangle is colliding with a rectangle, so that I can push it back ...
3
votes
1answer
129 views

How do I efficiently render the tiles of a tile map?

I've been working on a game, and I've been using Python with Pyglet to create it. I had an issue on how I could do effective tile based rendering. I tried cocos2d, however the API is very efficient ...
1
vote
1answer
139 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
143 views

TCG - how to program cards as separate entities

So I'm planning to try making a card game (in Java) but I'm not sure what the best way to design it is. I understand the engine stuff but not how the cards should be coded an how they should interact ...
0
votes
0answers
37 views

Figuring out commands of PyMo

I'm trying to develop a game for my mobile phone (runs on Symbian Belle), just something to learn how, not really planning on distributing and I've found a game engine called PyMo (SourceForge main ...
1
vote
1answer
154 views

Python game loop approach?

I intend to write a game in Python and, later, if needed, offload any performance-critical sections of code to C++. I want to use Python basically because I am really familiar with the language and I ...
3
votes
2answers
196 views

How to optimize my A* algorithm

I'm working on a roguelike, and I think my A* algorithm is insufficient. My general algorithm for building the dungeon is: Place rooms Figure out which rooms should connect by a relative ...
3
votes
1answer
125 views

What's the difference between Pygame's Sound and Music classes?

What are the key differences between the Sound and Music classes in Pygame? What are the limitations of each? In what situation would one use one or the other? Is there a benefit to using them in ...
11
votes
3answers
677 views

How to make natural-looking paths with A* on a grid?

I've been reading this: http://theory.stanford.edu/~amitp/GameProgramming/Heuristics.html But there are some things I don't understand, for example the article says to use something like this for ...
2
votes
1answer
311 views

How to march tiles together like in Terraria?

I've been trying to get tile marching to work like in Terraria, and I got something to work. I don't think it's actually very good way of doing this, so I'm wondering what would be really the main way ...
0
votes
1answer
148 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 ...
-2
votes
2answers
85 views

Pygame 2d map error [closed]

I'm writing a Legend of Zelda like game in pygame. I have this code for loading a map from a text file. #Load maps f = open ("map1","r")#This file is a text file containing only: 1 map01 = f.read() ...
2
votes
1answer
126 views

How can I get post-processing effects with pygame?

I'd like to be able to make the screen like blurry and wavy, like when a player enters a portal in Minecraft. How would I make this with pygame?
0
votes
1answer
126 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 ...
1
vote
2answers
189 views

Sprite erasing text in Pygame

I'm making a Pong clone in which the user can press the 'p' button to pause/unpause the game. When the user presses the 'p' button the word 'PAUSE' is drawn to the screen and when he presses again the ...
1
vote
2answers
150 views

Monster attack is not randomising right [closed]

I have a code that I've been messing around with and the monster attack (monster.ma) isn't randomising after the first time it's called upon (elif statement). I've tried to make it a tuple since they ...
0
votes
2answers
132 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
1answer
174 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
2answers
273 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
358 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 ...
-4
votes
1answer
168 views

How good can the graphics get on a game made only with Python? [closed]

Aside from the game being fun, which is the most important, is it possible to make a "good looking" game with it? The graphics I mean. Like Angry Birds. Could that be made in python, looking like ...
1
vote
1answer
123 views

How to get the angle to an object from angle you are facing [duplicate]

I am making an creature simulator where the creatures have a neural net for a brain. One of the inputs to the net is the angle it has to travel to go to be facing the nearest piece of food. I can get ...
3
votes
1answer
258 views

How do I use more than 32 textures in my game?

I'm building a game in OpenGL, relying on shaders as much as possible because python. However, I think I've been working under a misunderstanding of OpenGL since I started. I've abstracted stuff into ...
1
vote
1answer
40 views

Mobu: Motion Files Naming Scheme for Unity

When exporting takes as several fbx files in Motionbuilder 2014 with File > Motion File Export..., the files are named like so: file_Take1.fbx file_Take2.fbx file_Take3.fbx In order ...
0
votes
1answer
73 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 ...
1
vote
0answers
243 views

pygame double buffering

I am trying to use double buffering in pygame. What I'm trying to do is display a red then green screen, and switch from one to the other. Unfortunately, all I have is a black screen. I looked through ...
0
votes
0answers
85 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 ...
22
votes
2answers
979 views

Random/Procedural vs. Previously Made Level Generation

What the advantages/disadvantages of using random/procedural generation vs. pre-made levels? There seems to be few that i can think of, other than the fact that items may be a problem to distribute ...
3
votes
1answer
163 views

How would one go about integrated python into a c++ written game for the use of user-made scripts

I'm quite new to game development (not the site) and I'm currently just trying to educate myself about some certain things before I really begin working and a game. anyway, I'd like to know what ...
0
votes
2answers
133 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 ...
1
vote
1answer
148 views

Python + Pygame - Collision problems

I'm currently developing a game in Python + Pygame and i came up with a problem with the player and the platforms. The game is a 'runner' where the player it's fixed (The 'x' position isn't variable, ...
4
votes
2answers
207 views

Accidental noise - Gradient function

Related to my previous question (2D Terra(ria)in generation - Accidental noise) I'm stuck on understanding how the gradient function itself works (in the Accidental library). After help on chat ...
2
votes
1answer
285 views

2D Terra(ria)in generation - Accidental noise

I'm currently trying to implement terrain generation as described on the following page: http://accidentalnoise.sourceforge.net/minecraftworlds.html. But I have issues understanding how to interpret ...
3
votes
1answer
419 views

Is There an Easy Way to Convert Python/Pygame code into C#?

I am working on a game, sort of like this and I want to convert it to C#, as it is currently written in Python. The reason of this is because I can add features more easily and with less writing in ...
0
votes
1answer
87 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 ...