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

learn more… | top users | synonyms

1
vote
0answers
10 views

Pygame time.get_fps() value

I was looking at the pygame.time.Clock.get_fps() method and after puting it inside of the while loop printing and checking it some times, i see that i starts to give its value after five frames (and ...
-1
votes
1answer
52 views

How to create a seemingly infinite text-based map in Python

I am looking to create a text-based map in which a player could (hypothetically) move through out infinitely. I was thinking I could do this through class objects defining towns / dungeons / etc. and ...
20
votes
3answers
2k 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 ...
1
vote
2answers
65 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 ...
1
vote
3answers
89 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 ...
1
vote
2answers
850 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 ...
2
votes
3answers
347 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.
2
votes
4answers
1k 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 = ...
2
votes
1answer
90 views

Collision detection with PyGame

I have been making a 2d platformer using Python with PyGame. It has all be going good, but I have stumbled accross many problems with collision detection. Here they are: You can't go through objects ...
0
votes
3answers
544 views

Python mini RPG enemy movement. (how to have two infinite loops running at the same time)

I have a problem with my RPG. I want enemies to wander randomly. So I put: enx_speed = random.randint(-2, 2) eny_speed = random.randint(-2, 2) in the main loop (while true:). However, that loops ...
0
votes
1answer
26 views

Pygame.display.set_icon unable to show transparecy

On Python 3.2.5 32 bit, I installed pygame. I made some code with it. It included pygame.display.set_icon(image). The image file is .png and I loaded it by using image = ...
2
votes
1answer
106 views

What Is A Good Way To Make A Self Updating Game? (Python) [closed]

I've been making games and I have always had a problem if I wanted to sell a game. People would have to re-buy games to get the updated version. Does anyone have any ideas on how to make a self ...
1
vote
1answer
34 views

How do I update individual sprites within a spritegroup in pygame?

I have a for loop that takes values from a text file, and then creates and adds a bunch of sprites to a group platformlist_list. The for loop will continue until every line of the text file is read. ...
1
vote
1answer
100 views

Implementing Shadow Mapping in Python and OpenGL 2.1

I am trying to create a little shadow mapping demo. My code is currently divided into three rendering passes: Pass 1 - Create the depth texture that will be used for shadow mapping on an offscreen ...
1
vote
1answer
53 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 ...
0
votes
1answer
43 views

Python: Character name and raw_input [closed]

I have a few lines of code here for Python: # Asks for a name def CC(): print "..." tick.clock(3) print "Welcome...\ What is your name, scared one?" name = str(raw_input("What is ...
0
votes
1answer
89 views

Pygame wall collision is acting very odd

I've been playing around with python for a while, but I only did basic functional programming. Lately, I've been teaching myself about classes. I've been using pygame (instead of tk, because let's ...
5
votes
1answer
708 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 ...
-5
votes
1answer
56 views

New to game development [closed]

I have some programing experience, and I have tried making some games. I have some knowledge with c#, but I am much better at python. I have a general code structure knowledge, so I am open to learn ...
0
votes
0answers
13 views

Spritesheet trouble / code review

http://stackoverflow.com/questions/34563084/spritesheet-trouble-code-review If the player presses right, i have an image of a guy facing right. Left, up, and down same concept. if he holds the ...
0
votes
1answer
25 views

Remove bullets from sprite Group

I'm having an issue with removing objects from a sprite Group. What is happening is I have a bullet class and every time the user presses the player shoots a bullet. I have 'alive = bool' code and ...
0
votes
0answers
28 views

How can I make bullets go to the cursor in Pygame properly

So hey, I'm new into making games and programming at all, I tried to make a small game thingy in Pygame that would include a dude shooting bullets and stuff. However, I can't really get the shooting ...
0
votes
1answer
35 views

Pygame making Snake, need help with generating fruit with a random color

This is my function for generating an apple, I want it to generate a random color each time the snake eats it. def AppleGenerator(): fruit_colors = ...
1
vote
1answer
191 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
25 views

Text blits to screen at wrong y-coordinate

I have a program that is meant to scroll numbers/letters down the screen, like in the movie "The Matrix". When one of the columns reaches a letter in the user's name (obtained using user input), it ...
2
votes
1answer
72 views

Pygame freezing on QUIT

I'm having problems with quitting a Pygame application (6502 based computer emulator). The part regarding exit looks like this: while True: do_something_200_times() for event in ...
5
votes
1answer
10k views

Pygame for python 3.5?

I just got Python 3.5 from... LINK: https://www.python.org/downloads/windows/ 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 ...
1
vote
1answer
21 views

Distance to rect edge from point based on direction

I have a rect that is at position (0,0) at the top left and is 2200x2200 in size. I am trying to specify the the distance to get to the edge of the rect in specific direction (degrees) from a point ...
2
votes
1answer
78 views

AI on a 2d grid in python

I'm trying to figure out how to do a simple search/chase AI. I know that I'm going to have to search around the mob entity to figure out if the player is close enough, I could probably get that done ...
2
votes
0answers
34 views

Does the latest version of Python have libraries for easy host/server connections? [closed]

We're working on a turn-based multiplayer Risk-type strategy game in Pygame, and I was wondering if there were any pre-existing libraries like PodSixNet that worked for Python versions 3 and up that ...
1
vote
3answers
131 views

Making games In Python [closed]

I'm a beginner at making games, and my eBook that I learnt Python from just made a 2D game and simple game like snake in Nokia because I want to know more Python in correlation with game development. ...
0
votes
3answers
71 views

how to avoid circular references between objects and map

I've been working on a turn based tactics game on a grid. I've been trying to figure out how to store and relate the grid and the objects on it. Essentially, my question boils down to how to ask ...
1
vote
1answer
79 views

Python - Holding down key to move a sprite works, but only in one direction [closed]

I've been testing out movement for a fighting game that I'm creating in Python. The problem is that when I try to move the sprite, it moves correctly to the left, but only ever works in that ...
4
votes
2answers
234 views

How to implement a mechanism to select language specific expression (python)?

On a game server, programmed in python, I want to be able to select language specific expression, according to the user's preference. Provided a 'name tag' and a 'language identifier' I want a ...
1
vote
0answers
290 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 ...
0
votes
1answer
899 views

How do I make a sprite collide with walls in pygame?

I've been trying to create a collision detection between the player (Blue), and the walls (Green), but the player can just move through the walls. I made it so that every collision is printed in the ...
0
votes
1answer
1k 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 producing very desirable results. If I ...
1
vote
2answers
560 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 ...
0
votes
1answer
104 views

How do I get pygame to work on intel processor?

I downloaded Python 3.4 64 bit IDE and pygame but whenever I tried installing pygame it would say "Not supported on Intel". So are there version of pygame available for Intel processor or are there ...
0
votes
1answer
348 views

Car Game: Engine and Gearbox calculations?

I am making a racing game inside of Blender Game Engine. You can see the latest video here to get the impression of what type of game it is: https://www.youtube.com/watch?v=0i3m-xXtnhc What I want to ...
1
vote
0answers
40 views

Get original image size in Ren'py

I'm building a visual novel and in one scene, I want to have a couple of different images move from one position to another and change size as it moves. My first position is called "doorway", my ...
3
votes
2answers
1k views

PyGame custom isometric engine : caching or not?

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 re-drawing the whole view tile after tile every ...
0
votes
1answer
61 views

How do I check if pressed on a text in pygame?

How do I check if pressed on a text? This is how I draw the text: # Full code on https://github.com/Zwengel/bunny-badgers height = pygame.display.Info().current_h font = ...
0
votes
0answers
15 views

Python & Pygame: How do I use this animated gif as background surface? [duplicate]

How would I go about putting an animated gif into my game in Pygame? I'm following along on the tutorial at inventwithpython (source) slidepuzzle.py My code is very similar, as I'm just beginning how ...
0
votes
1answer
97 views

how to generate road in racing game

I'm making a racing game in python and I kind of wrote myself into a corner. This for loop: for i in objects: if i.name == "road": if i.y == 0: road = ...
1
vote
2answers
243 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 ...
1
vote
1answer
59 views

scrolling ruining bullet physics

the code below is the bullet class for my shooter game in pygame. as you can see if you run the full game (https://github.com/hailfire006/economy_game/blob/master/shooter_game.py) the code works ...
0
votes
2answers
71 views

Firing attack and take_damage events on entity attacking?

I have an Entity class with health, armor, and damage. I want my entities to raise some kind of take_damage and attack events whenever they attack or take damage. Here's my current implementation: ...
0
votes
1answer
116 views

Diagonal Movement with Pygame Rect Class

I have been using pygame and have been struggling to understand how to implement vectors and the pygame rect class to make an image move diagonally on the screen at the correct speed.I know it must be ...
1
vote
2answers
195 views

Implementing monte-carlo tree search in a tile based game with units

I have this simple risk-like game I would like to develop an AI for. Players move their Units on the map and a simple fight resolution is done. There is a time constraint of 100ms for each round, the ...