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

learn more… | top users | synonyms

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 ...
1
vote
3answers
232 views

Multithreading for a mixed-genre game in Python?

So here's the situation. I'm making a game that mixes two genres; arcade shooter and puzzler. They don't intertwine TOO much; all the interaction that really goes on is that every time an enemy is ...
1
vote
2answers
256 views

How to detect whether or not a tile is occupied?

I'm using Python 2.7 on Win7x64 with PyGame What is the best way to iterate over all the tiles in the game or screen, efficienty? Ideally I have about 800 tiles, but that is a dynamic number I've ...
1
vote
1answer
2k views

How can a pygame image be colored?

How can I color a Pygame image surface? I either want to change every pixel that is color A into color B, or else change every pixel into color B. Either works, so long as transparent regions remain ...
1
vote
2answers
217 views

Searching a map fewer times

... or better yet, removing the need to search the map altogether. I'm either looking for suggestions on how to optimize my code, or a change in design. In my component-based entity system, the ...
1
vote
4answers
2k views

When learning, nothing is better than practice

A little introduction: I'm 25, and going to this private french school, CreaJeux, which begins in october. I will be learning mostly game programming, something I wanted to do a long time ago, since ...
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 ...
1
vote
1answer
352 views

How do I determine if one value is within a certain range of another in Python

I've been working on the attacking in my RPG. The problem I have recently encountered is, I have to be in Exactly the same x coordinate as the Enemy. When I want to attack the enemy this is what ...
1
vote
3answers
596 views

Solving the riddle on distributing a python built game?

So, I've done the research, and i've done the try/catch process of almost getting things to work. . . almost. I've read this chart: ...
1
vote
2answers
270 views

How to implement rectangle selection?

I don't know if there is another term for it, but I mean this: You hold down a mouse button. A rectangle forms when you move the mouse around. The units inside the box get selected when you let go of ...
1
vote
1answer
206 views

Pixelated and incomplete image when loading with pygame.image.load

This is the image I'm trying to load on the surface, an 40x40 Ubuntu logo: Ans this is how it looks when trying to show the image on the surface via the blit method: I'm trying to load different ...
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 ...
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 ...
1
vote
2answers
225 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
1answer
429 views

pygame performance issues

I'm trying to make a tactics game using python and the infamous pygame library. I use threading for networking and pathfinding. The game uses a p2p lockstep architecture, with one of the players ...
1
vote
1answer
288 views

Pygame - Change sprite collision Rect

I'm making a platformer in Pygame. One of the sprites I'm using is a flag, and I want to detect if the player collides with the flagpole (just like in Super Mario Bros). The problem is that the image ...
1
vote
1answer
267 views

Embedding Pygame to C++ [closed]

If embedding Pygame to C++ to have a game be an executable, is there any extra process I would have to use in order to use Pygame functions when embedding into C++? As opposed to just writing ...
1
vote
1answer
127 views

Drawing over objects occasionally leaving relics behind

I'm drawing a large number of bouncing shapes similar to an old 1990s screensaver. I'm just doing this to study (but not hopework) For some reason my object clearing (simply blitting a black shape ...
1
vote
1answer
387 views

OpenGL: Rotating cannon about non-centre position?

So I have a "cannon" object (basically a long cylinder) and I want to be able to control its angle. The code I have now is: glPushMatrix() glTranslatef(self.position.x,2.5,self.position.z) ...
1
vote
1answer
784 views

How can I fix these errors with Panda3D's sample projects?

I just installed the latest Panda3D packages on a Mint 12 32-bit virtual machine. Then I downloaded and configured Eclipse and tried to run the Asteroids sample project. The window is created ...
1
vote
2answers
275 views

shuffle a sprite group

Is there a way to shufle a group of sprites created with: pygame.sprite.Group() I have tried using random.shuffle but it apparently doesn't work on sprite groups.
1
vote
1answer
64 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 ...
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 ...
1
vote
1answer
66 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 ...
1
vote
1answer
209 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
46 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 ...
1
vote
1answer
166 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, ...
1
vote
1answer
1k views

Pygame 2D Scrolling Map

I have currently a pygame program that stores tiles in a 2d list like [[1,1,1] [1,1,1] [1,1,1]] where the 1 is a tile object. I have the character centered in the middle of the screen, and I am ...
1
vote
1answer
153 views

Looking for a library to create a grid based first person game online

Before I go and build it myself, I have been looking for a library that may help making a grid based first person view similar to: https://www.youtube.com/watch?v=GwmZoCFd4Us I plan to make a web ...
1
vote
3answers
420 views

How can I make smoother upwards/downwards controls in pygame?

This is a loop I use to interpret key events in a python game. # Event Loop for event in pygame.event.get(): if event.type == QUIT: pygame.quit() sys.exit() if event.type == ...
1
vote
1answer
473 views

Pygame Import Error, Python 3.2

I'm having an issue with the Pygame module. I run Python 3.2 and installed the respective Pygame file, but now when I try to import it in the IDLE, it gives me this error: >>> import pygame ...
1
vote
2answers
321 views

Implementing Online Leaderboards for indie windows PC Game

I've just finished my game and I'd like to add some ranking functionality to it. I have a mySQL database running on my website and want to be able to insert and retrieve data from it. My knowledge in ...
1
vote
1answer
415 views

Implementing powerups for my Breakout clone

I'm making a simple Breakout clone in Python that will have very many powerups/powerdowns (so far I came up with 26). Some will affect the paddle (paddle missile, two paddles, short paddle, etc.), ...
1
vote
1answer
2k views

Exporting UV coords from Blender

So I have searched on google and various other websites but I've not found an answer. The only ones I did find did not work. So my question is how do I get UV coords from blender (2.63)? Currently ...
1
vote
2answers
565 views

Bullet physics in python and pygame

I am programming a 2D sidescroller in python and pygame and am having trouble making a bullet go farther than just farther than the player. The bullet travels straight to the ground after i fire it. ...
1
vote
1answer
699 views

MMO Proxy Server

I am building an MMO and someone told me I should never have my application interfacing directly with the net, and that I should have a local proxy. This makes sense, with security issues and scaling ...
1
vote
2answers
515 views

Pygame circular cropping/masks

I have been going through the documentation and the Pygame functions and classes today, but couldn't find a reasonable way to either create a circular crop of an image or how to use a mask to perform ...
1
vote
2answers
311 views

Secondary monitor freezes game window

I was bored and dragging my game window around the screen and noticed something interesting. When I drag my game window over to my secondary monitor, the screen updating just completely freezes. Is ...
1
vote
0answers
78 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
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
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 ...
1
vote
2answers
764 views

Packet handling system architecture?

I'm working on a multiplayer Flash game (ActionScript 3) with an accompanying server written in Python and I'd like some tips regarding networking, and specifically, the handling of packets and ...
1
vote
3answers
179 views

Geometry problem for area of sight

My player have a line of sight and all objects between the white lines, turns red. To compute this, the following conditions are met: if the angle between the yellow line and the red line are small ...
1
vote
2answers
362 views

Pygame's rotation methods have crippling issues, but is it me or Python's pygame?

http://www.youtube.com/watch?v=lNJFxvR6ex8&feature=youtu.be On rotate and rotozoom, can't find fixes on these on the internet, anywhere. Basically, the video is showing 4 things in this order: 1. ...
1
vote
0answers
146 views

Which technology should I choose to develop this fisheye perspective game? [closed]

I'm going to develop a 3D game, that a player walks in a maze with a 3D first-person perspective, collects things and escapes a monster. The game itself is very simple, but as it is not for ...
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
209 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". ...
1
vote
1answer
576 views

Python/PyGame mixer.music playback of OGG file has intermittent clicking sound - how to proceed?

I have a class within my python + pygame game that handles sound - it worked well until I tried use pygame.mixer.music to switch between streaming .ogg music files. The class switches between them on ...
1
vote
0answers
327 views

Loading Obj Files in 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: ...
0
votes
4answers
1k views

When should I learn Pygame?

I've been learning python for about 2 months now. I think I'm getting used to the language. My question is, when should I start learning Pygame? Or how do I know if I'm ready for it? I'm learning ...