Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [python]

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

Filter by
Sorted by
Tagged with
10 votes
2 answers
5k views

How can I distribute a native executable for a Python program?

Lately all of my work has been in Python (and Ruby), and I'm in love with those two languages. There are many libraries for game development on Python but the problem I see is that many of those ...
user avatar
19 votes
4 answers
13k 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 ...
Julian's user avatar
  • 193
3 votes
1 answer
1k views

How should my game characters store their abilities/spells?

I'm new to game development and a bit confused about how to effectively store an object's access to certain spells/abilities. The player and mob objects are all generated from the same class. However,...
Vecta's user avatar
  • 147
30 votes
5 answers
230k views

Famous games written in Python [closed]

I've seen a couple of these, namely Java and C#/XNA...and I've recently been picking up Python. Which kind of made me think. What (famous) games have been written in Python, with Pygame/Pyglet/...
7 votes
8 answers
17k views

Alternative to pyGame? [closed]

i'm learning something about game programming from a book about "pyGame". pyGame is simple, but... python is a little complex and different from my previous knoweledge about programming. I know "...
stighy's user avatar
  • 427
7 votes
3 answers
8k 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 Minecraft-...
theabraham's user avatar
4 votes
5 answers
2k views

Collision detection performance problem

Using python and pygame I've built a collision detection system according to the instructions in this YouTube tutorial. This is updated 40 times per second and controls movement and collision ...
Anonymous Entity's user avatar
4 votes
3 answers
2k views

How can I add biomes to my generated world?

I need a way to generate a world realistically. I want to generate worlds similar to dwarf fortress. My current code for world generation is this: ...
Roylat Gnail's user avatar
4 votes
1 answer
2k views

pyOpenGL draw loop - slow with just 1500 items to draw

I've been trying to build myself a simple little game API using pyOpenGL (previously I tried using just Tkinter, but I keep hitting the same wall whatever I do!) I rewrote everything using my very ...
MalphasWats's user avatar
3 votes
1 answer
2k views

Pathfiding for groups of agents

How can we refine this path search method to make group movement more elegant? I'm trying to make a RTS-style game, using a 2d tiled gameworld. I have implemented an A* pathfinding algorithm which ...
Anonymous Entity's user avatar
2 votes
1 answer
1k 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 ...
Busata's user avatar
  • 257
2 votes
1 answer
1k views

How do I sort with both depth and y-axis in OpenGL?

Continuing my misadventures in pyOpenGL, I've refactored the whole thing to use 4 buffers: tile vertices - all drawn at the start, probably never modified tile texture co-ords - not modified often (...
MalphasWats's user avatar
1 vote
3 answers
3k 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 ...
Niroshan's user avatar
  • 133
1 vote
2 answers
3k views

How can I publish a Python game on itch.io as html?

I'm making a game with Python, using Pygame. I want to publish my game on itch.io so that it's playable in the browser. Is there a way to do this? If so, how?
Devin Little's user avatar
0 votes
1 answer
1k views

Trying to make a python map editor

The program is supposed to read the pixel color values from an image, and use that data as a map for where to place objects in a game world. Getting the color values was easy enough: ...
Anonymous Entity's user avatar
0 votes
1 answer
1k 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". ...
lhk's user avatar
  • 408
21 votes
5 answers
15k views

noSQL - Is it a valid option for web based game? [closed]

Out of an opportunity and boredom, a friend and I decided to make a web based game. This is the first 'game' I will be making, since usually I program web apps in django. I've opted to use the same ...
Pran's user avatar
  • 381
19 votes
3 answers
9k 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. ...
Ken's user avatar
  • 870
10 votes
3 answers
3k views

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

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 ...
Anton Barkovsky's user avatar
8 votes
4 answers
4k views

What library for octrees or kd-trees? [closed]

Are there any robust performant libraries for indexing objects? Objects would have bounds themselves, rather than being represented by points; and an object could therefore be in more than one ...
Will's user avatar
  • 6,977
8 votes
2 answers
30k views

Locking the frame rate in pygame?

I am having trouble setting up the frame rate in my first game. I know that I can set it up with: clock = pygame.time.Clock() clock.tick(60) but this is not ...
DragonDePlatino's user avatar
7 votes
2 answers
28k 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. EDIT: I am now using ...
user19642323's user avatar
7 votes
1 answer
5k views

How do you create a perfect maze with walls that are as thick as the other tiles?

http://journal.stuffwithstuff.com/2014/12/21/rooms-and-mazes/ I read this article about dungeon and maze generation. The author uses a kind of specialized algorithm for generating 'perfect' mazes ...
Curtis Sherwood's user avatar
6 votes
3 answers
4k views

How to render metaballs?

How to render metaballs? I am a Python programmer familiar with the Panda3d and Blender3d APIs. My math kinda sucks, but I know enough to write game logic code and procedural model generation code, ...
user avatar
5 votes
1 answer
2k 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 ...
user avatar
4 votes
2 answers
2k views

Collision Resolution of Axis-Aligned Bounding Boxes that Change Size

I am developing an action platformer in Python, with Pygame. That said, my question is a general one about collision resolution strategies. I use an axis-aligned bounding box for the purposes of ...
DyingIsFun's user avatar
  • 1,307
4 votes
2 answers
477 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 (...
Busata's user avatar
  • 257
4 votes
1 answer
2k 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 ...
Snarkeet's user avatar
  • 143
3 votes
3 answers
3k views

Publish Python Game [duplicate]

I wrote a Python game in for a group project using Pygame. Now we wanted to package it into an executable but I can't seem to do it. When I was working with C# through Microsoft Visual Studio it had ...
Tom Prats's user avatar
  • 289
3 votes
2 answers
4k views

How do I detect multiple sprite collisions when there are >10 sprites?

I making a small program to animate the astar algorithm. If you look at the image, there are lots of yellow cars moving around. Those can collide at any moment, could be just one or all of them could ...
iCodeLikeImDrunk's user avatar
3 votes
1 answer
2k views

Pygame performance issue for many images

I've made a script for generating a game world based off of image pixel data. Trying to make a python map editor My progress so far has resulted in a program which loads an image and draws sprites ...
Anonymous Entity's user avatar
3 votes
2 answers
3k views

Pygame: Collision detection

I've been adding some extra stuff like Gravity and a table to a simple pong game made with Pygame and Python, the problem is that I don't know how to add collision detection, so when the ball hits the ...
Python Addict's user avatar
3 votes
4 answers
221 views

Ways to track time and character ages across many years of game time?

I'm working on a system to track large numbers of characters across long periods of time. Characters grow old and die, give birth to new characters, etc. It's a grand-strategy game, with warring ...
Somatic's user avatar
  • 249
3 votes
2 answers
412 views

How should I efficiently store faction relationships?

I'm working on a game that follows the life of a powerful magician as she lives, dies, and reincarnates dozens of times across hundreds of years. Meanwhile, empires rise and fall around her--she can ...
Somatic's user avatar
  • 249
3 votes
5 answers
11k 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: ...
user avatar
2 votes
2 answers
16k views

Pygame - implementing a scrolling camera

I am currently making a 2d game in Pygame and have run into a roadblock trying to make a scrolling camera (follows the character). I have seen some other answers to similar questions, but they have ...
thevengefulco's user avatar
2 votes
4 answers
33k views

smooth movement pygame

Hello im trying to learn more about smoother movement in games. I have created a little program to hopefully help me understand this. As far as i can tell i am suppose to track time, and update ...
Steffen Søborg's user avatar
2 votes
1 answer
3k views

How can I change the anchor point of a Pyglet sprite?

while trying to make my game, I noticed that you can't change the anchor point of sprites in pyglet. I use some convoluted way (see bottom of the post) to draw my minimap (WIP) so that the rooms are ...
ShadowFlame's user avatar
2 votes
1 answer
533 views

How do I create a selection rectangle?

I have a basic prototype working with health, resources and units. The problem is: How do I select multiple units? I have an idea of making an rectangle which dynamically extends with the mouse ...
piyush_dev's user avatar
2 votes
3 answers
1k 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....
user avatar
2 votes
2 answers
2k 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 ...
Serial's user avatar
  • 238
2 votes
2 answers
3k views

Generating different maps using Perlin Noise with a seed

I am developing a 2D game in python and I could get Perlin Noise working with this code: ...
Simple coder's user avatar
2 votes
1 answer
5k 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 ...
Ryan's user avatar
  • 145
2 votes
1 answer
3k 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 ...
planestepper's user avatar
1 vote
1 answer
55 views

Player not sliding on the side of a wall when two keys are pressed

I am making a game right now, and I am working on collision for different Rect walls (all of their data is stored in a list). It works great, except for one problem:...
Tiimzee's user avatar
  • 133
1 vote
2 answers
857 views

How to create old-school format music with small file sizes

My friend and I have been working on a project recently, and because we are hard coding everything (other than the graphics library, Pygame), the total size for our project is super small. I feel like ...
Nick Jarvis's user avatar
1 vote
1 answer
3k views

Scaling window contents in Pyglet?

I'm trying to scale a window's contents so that every pixel displays at a multiple of it's normal size. Basically I want to achieve larger pixels without scaling each and every individual sprite. This ...
Vine's user avatar
  • 173
1 vote
1 answer
616 views

Python library for scripting (C++ integration)

Please advise me good wrapper/library for python. I need to implement simple scripting in c++ app; Under "good" I mean pretty understandable, well documented, no memory leaking, fast. For creating ...
Edward83's user avatar
  • 388
0 votes
1 answer
993 views

How can I make tiny sprites larger?

I used a 16x16 sprite pack to make a 640x640 map in pygame: The problem is that everything is extremely tiny. How could I go about making the expected "JRPG" look, like this for instance: I have ...
hereformymousepad's user avatar
0 votes
1 answer
2k views

How to restart game from end screen, rather than resume the previous game state?

Video as you can see there I am trying to make my end screen restart my game but whats happening is that its not restarting my game its just loading the same thing when I die >> how could I make it so ...
Habib Ismail's user avatar