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

learn more… | top users | synonyms

0
votes
1answer
49 views

Mutlplayer game organization [on hold]

I'm planning to create an RPG that you can play in multiplayer. The graphics will be simple ASCII. I will do the client C and the server in Python. Having never done a multiplayer game was wondering ...
0
votes
1answer
26 views

How to change the position of a circle in pygame in three stages

I will try to explain it as well as I can excuse me if I'll fail. I have the following simple game situation: I know the coordinates of each point. So each of the green points try to hit the blue ...
0
votes
1answer
47 views

Oblique launch within a game

I'm creating a simple game in python that will follow the same logic of DDTank and Worms. The graph is formed by characters. The buildings that will be destroyed are formed by '*', players are '@' and ...
5
votes
1answer
518 views

What's the 'proper' way to get unit vectors?

My apologies if I've misunderstood the term 'unit vector' or misapplied it in concept, but I think that is the term for an object's heading when expressed as [x, y] when x and y are a value between -1 ...
0
votes
1answer
36 views

Efficiently tracking active instances

I'm creating a game with lots of instances. On each iteration of the game loop, I only want to deal with the ones that are near the player. Currently, I do this by constructing a list of all the ...
0
votes
0answers
18 views

pygame.display.update(list) updates entire screen, not just rectangles in list

I have two "sprites", one following the mouse and one that moves with WASD. They aren't really pygame.sprite.Sprite objects, but they move like this: Paint over original position with that piece of ...
1
vote
1answer
96 views

Best practice to implement persistent data when using Tiled TMX map files?

A friend of mine and I are always talking about our current progress in learning game development. Recently, saving the game (data persistence) came up, and when I summarized how I tackled that for my ...
3
votes
1answer
442 views

Any way to embed Pygame in webpages?

I have a Pygame game, and I was wondering if there was any way to embed it into a webpage to make it easily playable, or if there is a games website that accepts Pygame games.
1
vote
0answers
53 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 ...
0
votes
1answer
50 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 ...
3
votes
1answer
150 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
1answer
135 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
81 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
49 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 ...
6
votes
1answer
335 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 ...
1
vote
2answers
149 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
65 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
90 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
89 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
63 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
267 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
66 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
38 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
108 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
58 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
55 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
77 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
45 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
87 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
127 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
95 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
128 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
149 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
66 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
96 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
279 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
158 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
212 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
2answers
351 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
284 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
234 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
226 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
220 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
707 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
406 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
180 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
123 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
179 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?