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

learn more… | top users | synonyms

0
votes
1answer
367 views

Pygame top down shooter firing bullets

I'm working on a top down shooter in pygame and am having trouble getting bullets to fire. I'm using a class for the bullets, I'll show what I think is the relevant code. This is what I do after the ...
-1
votes
2answers
50 views

Basic Python Question, Working with Function and List [closed]

I'm new to programming and learning Python over the web and I'm stuck on this problem. The objective is to have a list of numbers and create a function that will evaluate that list of numbers and ...
4
votes
1answer
367 views

What to pass to scripting

I am using Java and libgdx to create a game and have decided to go a data driven approaching with Jython for this refactoring (just picked up Jython, have used Java for a while). The game is a ...
2
votes
1answer
510 views

Detect collision in Blender

I am trying to write a Python function for Blender(2.66) game engine, that permits me to detect collision between two objects. I tried to read the documentation, but it's very confusing, and I don't ...
0
votes
1answer
65 views

How to determine the best approximate direction [duplicate]

I want to determine which sprite to use when one agent is "facing" another agent. My game is 2d, and uses 8-directional movement. Deciding which sprite to use for movement is easy enough since there ...
2
votes
1answer
225 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 ...
1
vote
1answer
329 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 ...
3
votes
1answer
248 views

Pygame: circular motion with Bresenham's algorithm

I'm trying to figure out a way to move an object in a circular path. I read about Bresenham's circle algorithm, but all the codes available online draw an entire circle. For my game, I want it so ...
0
votes
1answer
186 views

Pong pygame problem

I've been following a tutorial to make my first Pong clone. Here is the tutorial: http://muagames.com/tutorials/pygame-3-pong/pygame-3-pong-step-1/ When I try to run it I get this error message: ...
1
vote
1answer
222 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 ...
2
votes
4answers
1k 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 ...
0
votes
0answers
48 views

How to modify graph ingame?

The pathfinding in my game uses this function to generate a graph: def make_graph(self, size, impassable): nodes = [[astar_gridnode(x, y) for y in range(size)] for x in range(size)] graph = ...
0
votes
1answer
122 views

How to make healthbar size relative to hp

Like in most games with healthbars, the units in my game have a hp_bar object which is a frame, with a slightly smaller rectangle inside which should get smaller (and change color) as a unit loses hp, ...
-1
votes
1answer
255 views

Flixel or Pygame for a small game? [closed]

I have some experience in Bash and Python, Lua. I've always wanted to try and make point & click quest games. Most quest games I loved aesthetically and gameplay wise were made with Flash. So ...
1
vote
3answers
448 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: ...
3
votes
0answers
79 views

Creating Animal Crossing style world rendering with Python [duplicate]

I've dabbled a bit with writing 3D rendering code in the past, although I'm interested in knowing if there is existing code (libraries) written for/with bindings to Python that might facilitate the ...
3
votes
3answers
304 views

Best way to network the movement of 2D tanks?

I'm working on a multiplayer Flash game with a Python server and I have a quick question regarding how I should send positional updates for tanks for other players. Should I choose Option A: When ...
-3
votes
1answer
393 views

Python 3d game engine? 2013? [closed]

I saw another question from 2011 on this, but it's 2013 What's the best 3d Python game engine to learn? Good documentation, cross-platform, good community, continuing development? I looked at ...
0
votes
1answer
113 views

Pygame Bounding Box at Player Feet

I'm new to python and pygame and am trying to build a very simple "game" (it's more of a test for me to figure things out) in which you move a character around the screen and he can collide with walls ...
1
vote
2answers
662 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 ...
18
votes
2answers
996 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 ...
3
votes
2answers
249 views

How to implement armor? [closed]

I am a newbie in Python, I am very bad at math too and I need some help. Also close/move this post if you feel this isn't the right place for it. Hero1 = 5000 # His HP is 5k. Hero1dmg = 200 # ...
1
vote
3answers
177 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 ...
2
votes
1answer
131 views

pytmx: issue trying to get the correct texture rectangle for sprite for objetcs on map

:D Hello :D I am currently developing a game engine. I'm using maps designed with Tiled and I placed several objects on a test map to develop the feature of loading objects as sprites/entities and ...
3
votes
2answers
508 views

Does it make sense to use Lua scripting in a game developed in Python?

Well for C++ written games using Lua scripts for easy changing ai, quets etc is very reasonable and it's common. However now I'm going to write a game in pure python and I don't know if I should use ...
3
votes
1answer
124 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 ...
0
votes
1answer
962 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 ...
-2
votes
2answers
183 views

Transfering a game from Python to C [closed]

I have a simple game RiceRocks which I want to translate into C programming language not C++,because I know C better. I know only basic C++ such as : loops,control statements, arrays. Where to start? ...
1
vote
2answers
243 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 ...
0
votes
3answers
2k 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 ...
1
vote
2answers
328 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. ...
3
votes
2answers
752 views

Pygame set_colorkey transparency issues

I'm having a strange issue that I cannot seem to remedy. I am doing some prototyping with Pygame on a desktop running windows and a laptop running OS X. Both are running python v2.7.3 (installed via ...
2
votes
2answers
163 views

Anybody know how I can write a game for the dualshock 3 or other gampad in python?

I am a new developer and want to write a game that uses a gamepad like the dualshock 3 I want to write it in python although am willing to learn a little C/C++ I need to identify the buttons and ...
0
votes
2answers
153 views

How do I implement unit selection in this program?

I'm trying to implement unit selection on a large, scrollable surface. # Arbitrary values for window size self.w, self.h = 1600, 900 # Game world surface, everything gets blitted to this, which is ...
1
vote
0answers
142 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 ...
3
votes
1answer
300 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 ...
3
votes
2answers
466 views

2D destructable terrain with collisions in MMO

Task What I want is to create destructable terrain (like in Worms) and collisions with this terrain (with calculated normals) that will be fast enough to work on server machine. Basically lets say ...
4
votes
5answers
541 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 ...
0
votes
1answer
271 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: import numpy ...
2
votes
1answer
88 views

Getting an instance of KX_PolygonMaterial in Blender

I've got a question concerning using Python in Blender's Game Engine. Before I start I want to state that I'm trying to change the color of an object in Blender's game engine. To do this, I'm ...
1
vote
1answer
230 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
0answers
137 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 ...
2
votes
2answers
416 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 ...
1
vote
3answers
212 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 ...
0
votes
1answer
137 views

add collision detection to sprite?

bassically im trying to add collision detection to the sprite below, using the following: self.rect = bounds_rect collide = pygame.sprite.spritecollide(self, wall_list, False) ...
0
votes
1answer
162 views

Using NumPy arrays as 2D mathematical vectors?

Right now I'm using lists as position, velocity, and acceleration vectors in my game. Is that a better option than using NumPy's arrays (not the standard library's) as vectors (with float data ...
-1
votes
2answers
334 views

Online scoreboard in Python?

So my friend and I are working on an arcade-style game in Python and Pygame. We're beginning to look at the feasibility of an online leaderboard, given our current programming backgrounds. Such a ...
1
vote
1answer
144 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
328 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
479 views

Pygame Tile Based Character movement speed

Thanks for taking the time to read this. Right now I'm making a really basic tile based game. The map is a large amount of 16x16 tiles, and the character image is 16x16 as well. My character has its ...