Questions tagged [python]

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

Filter by
Sorted by
Tagged with
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/...
22 votes
3 answers
9k views

How to structure code for many unique weapons/spells/powers

I'm an inexperienced programmer creating a "roguelike-like" game in the vein of FTL, using Python (no PyGame as of yet as I'm still only concerned with text). My game will contain a large number of ...
henrebotha's user avatar
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
20 votes
4 answers
38k views

What's the best Python 3D engine? [closed]

I want a straight 3d Python engine that's easily obtainable for linux and easy to use. Soya3D failed for me because of the lack of documentation. I should be able to load common 3D models without an ...
John Riselvato's user avatar
19 votes
3 answers
8k 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
  • 860
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
18 votes
2 answers
6k views

Why does my sprite player move faster when I move the mouse?

I'm trying to develop a simple game made with Pygame (Python library). I have a sprite object which's the player and I move it ...
Drumnbass's user avatar
  • 295
14 votes
5 answers
7k views

Python Performance vs Game Maker [closed]

I was originally thinking of creating a game with Python and SFML. I understand Python is slow compared to C++, but how is it compared to Game Maker? The main reason I ask is I recently played a Game ...
user avatar
13 votes
6 answers
5k views

Efficient Algorithm for the boundary of a set of tiles

I have a grid of tiles of a known finite size that forms a map. Some of the tiles inside the map are put into a set known as a territory. This territory is connected, but nothing is known about its ...
ScienceSnake's user avatar
13 votes
3 answers
4k 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 ...
Anonymous Entity's user avatar
11 votes
3 answers
9k 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... ...
Vine's user avatar
  • 173
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
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
10 votes
3 answers
451 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 ...
user avatar
10 votes
1 answer
57k views

Pygame for python 3.5?

I just got Python 3.5 from this link. Previously I had Python 3.4 and the Pygame version 1.9.2a0. It worked perfectly. However, my the new Python 3.5 isn't compatible with that version of Pygame that ...
EdinsonC's user avatar
  • 161
9 votes
2 answers
2k 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 ...
Ben Blank's user avatar
  • 233
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
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
1 answer
27k 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] ...
Stick's user avatar
  • 339
8 votes
4 answers
1k 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 ...
timfreilly's user avatar
8 votes
1 answer
2k 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 ...
doppelgreener's user avatar
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
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
7 votes
2 answers
5k views

OpenGL - Stack overflow if I do, Stack underflow if I don't!

I'm in a multimedia class in college, and we're "learning" OpenGL as part of the class. I'm trying to figure out how the OpenGL camera vs. modelview works, and so I found this example. I'm trying to ...
Wayne Werner'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
2k views

Creating a 2D skeleton animation system for use with Panda3D

Hey. I want to be able to create a system for 2D skeletal animation in my game. I'm using panda3d as my game engine. I'd like to be able to make simple bone structures and skin them with my sprites. I ...
sonicbhoc's user avatar
  • 351
6 votes
2 answers
2k views

How do I sync entity ids with the server and client?

I'm continuing my experimentation with entity component design by making a multiplayer space/trading/combat game with python and panda3d. My component system is a simple version of java's artimis. The ...
croxis's user avatar
  • 125
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
6 votes
2 answers
2k views

Panda3D documentation, manual, and tutorials for offline viewing?

Is there a way to get the Panda3D's manual and tutorials available for offline viewing? I'm going on a business trip and I will spend a good deal of time at the airports and on long flights. I'd love ...
shadowprotocol's user avatar
6 votes
1 answer
2k 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 ...
sec_goat's user avatar
  • 207
6 votes
2 answers
1k views

How to write reuseable components for pygame

Is there a recommended way to write reuseable components for pygame? Simple example would be a FPS counter. Should I write a class which has an init, update and draw method and call them from inside a ...
apparat's user avatar
  • 163
5 votes
4 answers
3k views

How do I use more than 32 textures in my game?

I'm building a game in OpenGL, relying on shaders as much as possible because python. However, I think I've been working under a misunderstanding of OpenGL since I started. I've abstracted stuff into ...
bonzairob's user avatar
  • 129
5 votes
2 answers
13k views

2D animation example in pyglet (python) looping through 2 images/sprites every x seconds

Suppose you have two images: step1.png and step2.png . Can anyone show me a very simple example in pyglet how to loop through ...
Bentley4's user avatar
  • 153
5 votes
2 answers
829 views

How can I handle a 2d game with tens of thousands of sprites rendering at the same time?

We are trying to make a small 2d game which requires an excessive amount of sprites spawning and moving around the screen at the same time. We did try doing this in python but it started choking at ...
Georg Ólafsson's user avatar
5 votes
3 answers
3k views

Writing Logic behind card games

I'm not a dev noob, but definitely never done anything in game dev. There is a trump based card game we play in town that I plan on coding. I'll be either using python/ajax/pyqt or c++/qt. My ...
dassouki's user avatar
  • 153
5 votes
3 answers
4k views

Making dialogue different with each playthrough

I'm making a little demo game where roughly half of the NPCs in a little town have a profession, as well as a personality. I'm trying to have the game procedurally create dialogue, so when an NPC is ...
Ertain's user avatar
  • 63
5 votes
4 answers
20k views

How can I make the player "look" to the mouse direction? (Pygame / 2D)

Here's my code: ...
Ericson Willians's 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
5 votes
2 answers
2k 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 ...
Raskolnikov's user avatar
5 votes
5 answers
3k views

Programming with Python in a recent version of Minecraft

I've been teaching Python programming to a friend's son using the book Adventures in Minecraft. This book comes with a starter kit that contains a pre-configured Bukkit (v.1.6.4) server, and targets ...
Florent's user avatar
  • 51
5 votes
2 answers
1k views

Simple 2D games - what is faster to render - images or drawing?

I am developing simple 2D environment in Pygame (Python 3.6), however I think this question is general. The environment is moving (player is rendered on the same position and everything else is ...
matousc's user avatar
  • 159
5 votes
2 answers
3k views

how to represent a nested menu system?

I'm wondering what would be a clever way of making a layered menu system, in terms of what data structures to use. An example of what I mean: A unit has the ability to construct buildings, and to ...
Anonymous Entity's user avatar
5 votes
0 answers
164 views

Scoreboard setdisplay list shows correctly per char. Can i make my sidebar show correctly per char as well?

So I've been writing a script over the last little while in Python that interacts with the Minecraft console. I'm basically trying to make a scoreboard based currency system that is world independent ...
VTSTech's user avatar
  • 51
5 votes
0 answers
2k views

Unity3D LLAPI and Pyhton UDP communication

I need a Unity3D game on Android to receive UDP packages from a Python script running on a different device. Using System.Net is not (yet) an option, as it is only supported on Android with a valid ...
mitras2's user avatar
  • 51
5 votes
0 answers
600 views

Blender - creating bones from transform matrices [closed]

Notice: this is for the Blender 2.5/2.6 API. Back in the old days in the Blender 2.4 API, you could easily create a bone from a transform matrix in your 3d file as EditBones had an attribute named "...
user avatar
5 votes
4 answers
17k 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...
elijaheac's user avatar
  • 199
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
6 answers
21k views

RPG movement holding down button

I've been writing a simple top down mini RPG in python. My problem is that when I move the player I have to repeatedly tap the arrow key. Each time I tap the key the player moves 5 PX in the ...
Cnorwood7641's user avatar
4 votes
5 answers
5k views

Handling random with unique chance in Python [duplicate]

Okay, let's say you have a handful of enemies, each with their own 'rarity' to spawn. For example: ...
Vine's user avatar
  • 173

1
2 3 4 5
13