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

learn more… | top users | synonyms

3
votes
1answer
128 views

game mod security question

So I'm in the process of building a game in C++ for the engine and Python for behavior and moddability. One of the planned major features is that when the game client connects to a game server with ...
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
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
1
vote
1answer
57 views

Splitting Pygame functionality between classes or modules?

I am attempting to make my pygame application more modular so that different functionalities are split up into different classes and modules. I am having some trouble getting pygame to allow me to ...
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 ...
5
votes
1answer
321 views

How do I measure the bounds of a string in PyGame?

I am trying to position some text on my screen using pygame, and knowing the size of the string would help. When using C# and XNA I could use SpriteFont.MeasureString("Hello World") to get the size ...
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, ...
-2
votes
1answer
63 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
1answer
65 views

How do I make a sprite move to another position using vectors

Ok, so far I have made the sprite move to a mouse position. But I got a question, does anyone know how to make a sprite move by itself without the use of a mouseclick from Point a to point b using ...
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
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?
2
votes
1answer
140 views

Howdo I load a GIF animation in pygame?

How can I load a GIF animation in pygame? With a web search, I found a severely outdated library called GIFImage. I tried it to do it with 2 pictures but I'm getting stuck because I'm a beginner. I ...
1
vote
1answer
56 views

How can I rotate my picture using Pygame?

I wanna make the Dragon on the picture rotate softly to the left when he flys to the left and rotate to the right when he flys to the right and up and down also. How can i do that with the keys w a s ...
0
votes
1answer
33 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 ...
1
vote
1answer
51 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
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
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 ...
1
vote
1answer
68 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
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 ...
1
vote
0answers
79 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
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
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 ...
2
votes
1answer
131 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
62 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
90 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
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 ...
3
votes
1answer
138 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
175 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
269 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
211 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 ...
1
vote
1answer
187 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
213 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
185 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
694 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
373 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
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 ...
-2
votes
2answers
107 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
153 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
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 ...
1
vote
2answers
226 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
167 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
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
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
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
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 ...
-4
votes
1answer
183 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
130 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 ...