Tagged Questions

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

learn more… | top users | synonyms

16
votes
3answers
3k views

How can I generate random lakes and rivers in my game?

I have a 2D block building game and am trying to make randomly generated lakes and rivers. I have looked into the Perlin noise algorithm, but, I couldn't get it to generate random and nice results. I ...
2
votes
3answers
640 views

Pygame window becomes unresponsive when I click it

I'm new to programming, python and pygame. This is some code I wrote to draw random colored rectangles on an 800 x 600 canvas. It does what I expected it to do but becomes unresponsive if I click ...
1
vote
2answers
266 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 ...
5
votes
2answers
598 views

Web-based micro-transaction API

I am currently making a browser-based game and I would like to integrate micro-transactions. However I would prefer not to have to implement my own storefront. Does anyone know of an available ...
3
votes
2answers
1k views

Python float 32bit to half float 16bit

I'm trying to write a 3D model exporter addon for Blender in Python and need some help. The spec of the 3D format uses some compression on the vertices, there is a vertex buffer that contains ...
0
votes
2answers
906 views

Detecting if line crosses rectangle in python. Need speed boost

I am currently writing a top down man vs robot shooter. The game works now, but if I have a decent sized level it runs slowly when you are being chased by robots. While just roaming around it can go ...
7
votes
1answer
1k views

How do I communicate with an IronPython component in a C#/XNA game?

My XNA game is component-oriented, and has various components for position, physics representation, rendering, etc, all of which extend a base Component class. The player and enemies also have ...
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
611 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. ...
2
votes
1answer
118 views

Velocity control of the player, why doesn't this work?

I have the following code inside a while True loop: if abs(playerx) < MAXSPEED: if moveLeft: playerx -= 1 if moveRight: playerx += 1 if abs(playery) < MAXSPEED: if ...
1
vote
1answer
656 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
1answer
422 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) ...
0
votes
1answer
1k views

Pygame import error [closed]

When I installed pygame and tried to run import pygame, I got this error: Traceback (most recent call last): File "<stdin>", line 1, in <module> File ...
1
vote
1answer
782 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 ...
2
votes
2answers
643 views

Scripting language with class instance support

I have come across the need to use a scripting engine for my C++ game, but after experimenting with many languages since the last few days, nothing has truly stood out as the obvious choice for a ...
3
votes
2answers
1k views

PyGame custom isometric engine : caching or not?

Sorry if this question about is a bit broad. In the game I'm making, I need an isometric view with some altitude, which means players can go behind a hill, and be partly or totally hidden. To avoid ...
5
votes
2answers
474 views

How can I incrementally generate an graph?

I just started a new project in which I'd like the game world to consist of procedurally-generated locations connected by teleporters. After a bit of research, I've discovered this to be called ...
3
votes
1answer
897 views

Fatal Python error: (pygame parachute) Segmentation Fault when using PyGame and cx_Freeze

I'm using cx_Freeze to package my PyGame game. I'm running Ubuntu Linux, so I used the source package. However, I got the following error when I run cxfreeze game.py: Fatal Python error: (pygame ...
0
votes
2answers
157 views

Spritegroups and colorkeys

I have a problem using spritegroups in pygame. In my situation I have 2 spritegroups, one for humans, one for "infected". A human is represented by a blue circle: image = pygame.Surface((32,32)) ...
-2
votes
1answer
111 views

Imports in python [closed]

Recently I downloaded a game off pydev and the imports for it look like this below. import pygame from pygame.locals import * However I have only ever created games by calling the in this way. ...
3
votes
2answers
733 views

Why can't I import third-party modules I've installed in the python-ogre SDK's interpreter?

Background Information I'm using the python-ogre SDK, located here, under Windows 7. The SDK seems to have its own interface to the python 2.7 interpreter, judging from the fact that the generic ...
0
votes
1answer
453 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". ...
1
vote
1answer
834 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 ...
4
votes
1answer
932 views

Are there any good engines for isometric collision detection and platforming?

I've decided to resurrect an old game idea I had years ago. I currently have zero experience with programming, but I'm going to begin studying either C#, Python or both in the near future. The issue ...
4
votes
5answers
782 views

Handling random with unique chance in Python

Okay, let's say you have a handful of enemies, each with their own 'rarity' to spawn. For example: monsterlist = [] snake = 'snake', 60 wolf = 'wolf', 80 antlion = 'antlion', 30 ...
7
votes
2answers
2k views

How can I resize pixel art in Pyglet without making it blurry?

I have a tileset of 8x8 pixel images, and I want to resize them in my game so they'd be double that (16x16 pixels, e.g. turning each pixel into a 2x2 block.) What I'm trying to achieve is a ...
1
vote
2answers
579 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 ...
2
votes
1answer
1k views

Pygame water ripple effect

I have Googled for it but there are no ready scripts - as opposed to the same effect on Flash. I have checked the algorithm on The Water Effect Explained and also tested an implementation of the ...
17
votes
3answers
3k views

What is a good algorithm for fractal-based procedural city layout?

Background I run a minecraft server where I'm going to design a starter city of fairly large scale. I have a series of things, like rule signs and mob cages, I would like to put in buildings there. ...
9
votes
3answers
5k views

Would a Python game run on multiple platforms?

I have plans to write a game in Python and probably some SQL. I'm concerned about how versatile my program will be when I finish it, ideally I'd like it to run on Windows, Mac, Android, and iPhone... ...
0
votes
1answer
489 views

python for game development [duplicate]

Possible Duplicate: Famous games written in Python Is python any good for game development? Can I have some examples of great indie python games. So I can have an idea what it's capable ...
10
votes
3answers
362 views

Should scripts interact with an abstraction of the engine?

I'm using Java and Jython, and after some research I discovered giving scripts direct access to the engine interface could be a mistake, as it would tightly couple the two. It looks like most ...
1
vote
2answers
219 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
3answers
523 views

Basic developing in python? [closed]

I have basic experience in Python, and I want to know which is the best library to use in development. I was looking originally at Pygame but found it a bit lacking in tutorials. Are there any good ...
1
vote
2answers
313 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 ...
4
votes
1answer
736 views

Issue with implemented Minesweeper algorithm

So I'm attempting to learn Python by way of Minesweeper. I've got experience with SDL, so I figured playing around with PyGame sounded like a fun way to learn the syntax of the language. Anywho, I'm ...
0
votes
1answer
408 views

Batch blit vs separate blit

A tutorial that I have followed had me collect and blit all of my sprites with the following lines: allsprites = pygame.sprite.RenderPlain((l_sprites)) allsprites.draw() At the moment, this is fine ...
-6
votes
2answers
493 views

I want to use Python as a scripting language for my game, can I use it purely with C (not C++)?

I want to use Python as a scripting language for my game, can I use it purely with C (not C++)? It is important to me that I not use C++, and purely use C instead.
3
votes
3answers
575 views

Problem in blitting a clean, crisp sprite

I am having a bit of a tooling problem...and I am unsure of how to solve it. I am currently using PyGame to try and write a simple Minesweeper clone, except my sprites that I made are hexagon based ...
2
votes
2answers
8k views

Pygame How To Use Collision?

Can someone tell me how to implement collision in Pygame? For example I have a sprite called A and another one called B. How do I detect if they collide in Pygame?
-8
votes
1answer
1k views

Alternative to C# and XNA? [closed]

I'm interested in Game Development, I know OOP programming and so, but I never used a Stable Language. My favourite language is Java, but people say that is not a good Game Language, since it can be ...
2
votes
1answer
1k views

Creating an mouse-friendly GUI in a “sort of” Python console mode

I'm developing a real-time rogue-like game during my spare time, using Python and libtcod, to learn programming (and have some fun). I would like to create some sort of mouse-friendly GUI, just like ...
-1
votes
3answers
1k views

When should I learn Pygame? [closed]

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 ...
8
votes
3answers
2k views

Is it a good idea to develop non-trivial 2d game in python?

I am planning to develop 2D space RPG and i am facing the choice: what is the best language to write it in? My candidates are C++, Java and Python. Obviously, I want to write game in Python because of ...
8
votes
4answers
878 views

Loading data for an RPG

I'm creating a small text RPG as a way to practice python and I'm running into a question about how to load data. The game is a wild west game, though that isn't too relevant, and I need to store ...
1
vote
3answers
604 views

sprite group doesn't support indexing

I have a sprite group created with pygame.sprite.Group() (and add sprites to it with the add method) How would I retrieve the nth sprite in this group? Code like this does not work: mygroup = ...
1
vote
2answers
286 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.
3
votes
2answers
752 views

Efficient player state architecture in Google App Engine

I am investigating Google App Engine for use in a browser based MMO. The player will make a server request when ever they build, buy or do any other action that the server needs to process. Therefore ...
2
votes
2answers
603 views

RenPy : Get an image depending on variables

I'm in the end of finishing a little game for friends made with RenPy and I'm having a hard time finding a simple solution to do the following. At the start of the game, the player choose between a ...
0
votes
3answers
1k views

How to convert .max files to .egg on linux

I am very new to 3d graphics and game engines and panda3d and python. I followed few panda3d tutorials and now I want to test them with few new models. High majority of 3d models in the internet are ...