Game development software based on the Python programming language.
0
votes
1answer
40 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 ...
0
votes
0answers
43 views
pygame object returns wrong button object
Another question from dumb developer :)
I have class for window:
class MainMenuWindow(Window):
# singeltone:
_instance = None
def __new__(cls, *args, **kwargs):
if not cls._instance:
...
1
vote
3answers
116 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 ...
5
votes
2answers
82 views
Pygame fails on KEYDOWN with Russian keyboard layout
When I press a keyboard button on a keyboard with a Russian layout, my application pygame game crashes with this message:
UnicodeEncodeError: 'ascii' codec can't encode character '\u0444' in ...
0
votes
0answers
22 views
pygame android preplash image stays for ever [closed]
I am facing strange problem for my small game written in python I am pushing this to andorid using this doc http://pygame.renpy.org/index.html
But my android-presplash.jpg stays for ever in the ...
0
votes
1answer
58 views
Collision in PyGame for spinning rectangular object.touching circles
I'm creating a variation of Pong. One of the differences is that I use a rectangular structure as the object which is being bounced around, and I use circles as paddles. So far, all the collision ...
3
votes
1answer
81 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
208 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 ...
1
vote
2answers
153 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
277 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
0answers
111 views
Pygame animation with different size sprites
I'm trying to create a simple top-view 2D rpg, in the style of Zelda and Secret of Mana, using PyGame. I've managed to make the beginnings of a game, with an animated character walking around. ...
1
vote
2answers
106 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. ...
2
votes
2answers
123 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 ...
1
vote
1answer
41 views
When to use pygame.sprite.GroupSingle?
I'm doing a game in which i have a ball which is controlled by the keyboard and the goal is to get is out of a maze without touching the walls.
I've added my ball sprite to GroupSprite
vehicle = ...
2
votes
2answers
71 views
Meaning of offset in pygame Mask.overlap methods
I have a situation in which two rectangles collide, and I have to detect how much did they collide so so I can redraw the objects in a way that they are only touching each others edges.
It's a ...
0
votes
2answers
129 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 ...
3
votes
1answer
166 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 ...
0
votes
1answer
145 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
...
1
vote
1answer
90 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
40 views
pygame App stops when playing OGG files after building with cx_Freeze
I've built a sample game using pygame and wanted to mess around with packaging it up. I found cx_Freeze which seems to do the trick, except for when it comes to playing OGG files.
If I run the app ...
3
votes
2answers
96 views
Pygame surfaces and their Rects
I am trying to understand how pygame surfaces work. I am confused about Rect position of Surface object.
If I try blit surface on screen at some position then Surface is drawn at right position,
but ...
1
vote
1answer
162 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
152 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
101 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)
...
1
vote
2answers
261 views
Pygame surface rotation, rect rotation or sprite rotation?
i seem to have a conceptual misunderstanding of the surface and rect object in pygame.
I currently observe these objects this way:
Surface
Just the loaded image
rect
the 'hard' representation ...
2
votes
2answers
122 views
Grouping surfaces in pygame to get an object with two movement points
I would like to create a simple tank using pygame. One would drive the tank by controlling he velocities of two caterpillar tracks. They should be the two single movement points of the vehicle.
I'm ...
0
votes
1answer
81 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 ...
0
votes
2answers
147 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
3answers
140 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
224 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 ...
1
vote
1answer
117 views
Pygame Import Error, Python 3.2
I'm having an issue with the Pygame module. I run Python 3.2 and installed the respective Pygame file, but now when I try to import it in the IDLE, it gives me this error:
>>> import pygame
...
3
votes
1answer
141 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 ...
1
vote
2answers
199 views
what is the best way to use loops to detect events while the main loop is running?
I am making an "game" that has pathfinding using pygame. I am using Astar algo.
I have a main loop which draws the whole map. In the loop I check for events. If user press "enter" or "space", random ...
1
vote
1answer
163 views
Embedding Pygame to C++ [closed]
If embedding Pygame to C++ to have a game be an executable, is there any extra process I would have to use in order to use Pygame functions when embedding into C++? As opposed to just writing ...
3
votes
1answer
93 views
Find out what word you are hovering mouse over
I want to be able to pop up something when the user hovers over particular words that are on a label in pygame.
Can anyone give me a good (or even bad) idea on how to implement this (doesn't have to ...
1
vote
1answer
195 views
Blending colors on Surfaces in PyGame?
So I'm making a game in Python and PyGame. I have aliens and blocks that each adopt one of several colors; rather than make several copies of them in different colors, I plan on making the sprite ...
2
votes
3answers
219 views
Complex collisions in pygame
I've seen many tutorials for simple rectangle or circle-based collision detection with pygame.
But how can I do more complex collisions with arbitrary polygons?
Is the only option pixel-based ...
2
votes
2answers
274 views
Detecting Units on a Grid
I am making a little turn based strategy game in pygame, that uses a grid system as the main map to hold all the characters and the map layout. (Similar to Fire Emblem, or Advance Wars)
I am trying ...
1
vote
1answer
220 views
Implementing powerups for my Breakout clone
I'm making a simple Breakout clone in Python that will have very many powerups/powerdowns (so far I came up with 26). Some will affect the paddle (paddle missile, two paddles, short paddle, etc.), ...
3
votes
1answer
116 views
pygame.Rect around circle
I'm trying to make a pong game in pygame, but I can't figure out how to put a ball circle, which I can create with pygame.draw.circle into a pygame.Rect object so i can use the colliderect function to ...
1
vote
1answer
123 views
Pixelated and incomplete image when loading with pygame.image.load
This is the image I'm trying to load on the surface, an 40x40 Ubuntu logo:
Ans this is how it looks when trying to show the image on the surface via the blit method:
I'm trying to load different ...
1
vote
1answer
113 views
Drawing over objects occasionally leaving relics behind
I'm drawing a large number of bouncing shapes similar to an old 1990s screensaver. I'm just doing this to study (but not hopework) For some reason my object clearing (simply blitting a black shape ...
2
votes
2answers
187 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
216 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 ...
0
votes
2answers
357 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 ...
6
votes
3answers
544 views
PyGame QIX clone, filling areas
I'm playing around with PyGame.
Now I'm trying to implement a QIX clone.
I have my game loop, and I can move the player (cursor) on the screen.
In QIX, the movment of the player leaves a trace ...
4
votes
1answer
189 views
What is the proper way to maintain the angle of a gun mounted on a car?
So I am making a simple game. I want to put a gun on top of a car. I want to be able to control the angle of the gun. Basically it can go forward all the way so that it is parallel to the ground ...
1
vote
1answer
568 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
1answer
346 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. ...
1
vote
1answer
366 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 ...