Game development software based on the Python programming language.
0
votes
0answers
47 views
Top down pygame collision detection
I'm writing a top down game and I'm trying to figure out how to make certain types of terrains impassable.
I have a dictionary of sprites:
terrains = [{"sprite": black}, {"sprite": dirt}, {"sprite": ...
2
votes
1answer
153 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 ...
0
votes
1answer
32 views
Getting collision detection in Pygames
I am writing a game in Pygame, I want to get collision detection. The aim is when a object hits another, the target object disappears. I want to avoid having classes and just have my code class less ...
-2
votes
2answers
58 views
Pygame 2d map error [closed]
I'm writing a Legend of Zelda like game in pygame.
I have this code for loading a map from a text file.
#Load maps
f = open ("map1","r")#This file is a text file containing only: 1
map01 = f.read()
...
2
votes
1answer
81 views
How can I get post-processing effects with pygame?
I'd like to be able to make the screen like blurry and wavy, like when a player enters a portal in Minecraft.
How would I make this with pygame?
1
vote
2answers
96 views
Sprite erasing text in Pygame
I'm making a Pong clone in which the user can press the 'p' button to pause/unpause the game. When the user presses the 'p' button the word 'PAUSE' is drawn to the screen and when he presses again the ...
1
vote
2answers
119 views
Monster attack is not randomising right [closed]
I have a code that I've been messing around with and the monster attack (monster.ma)
isn't randomising after the first time it's called upon (elif statement). I've tried to make it a tuple since they ...
0
votes
2answers
63 views
Crossfade Between Two Music Tracks in Pygame
My intention is to have two music tracks, which are similar in nature, fade between each other at various times. When such a fade occurs, one music track should fade from full volume to muted in a ...
0
votes
1answer
109 views
Pygame - CollideRect - But How Do They Collide?
I'm having some trouble figuring out how I can handle collisions that are specifically colliding on the top or bottom a rect. How can specify those collisions?
Here's a little code snippet to give ...
-1
votes
1answer
50 views
How to make an image bounce off the edges of the screen in Pygame?
I'm making a simple game where I bounce and image off the sides of the screen (a bit like the ball bounces in Pong) but I can't seem to the the bouncing part to work. Instead of bouncing of the edges ...
1
vote
1answer
93 views
How to get the angle to an object from angle you are facing [duplicate]
I am making an creature simulator where the creatures have a neural net for a brain.
One of the inputs to the net is the angle it has to travel to go to be facing the nearest piece of food. I can get ...
2
votes
1answer
137 views
Tile based map player movement
I'm doing a tile based 2d rpg in pygame. The problem I'm working on right now is character movement...
I am already able to create a map by using multidimensional arrays and a 'camera' follows the ...
3
votes
1answer
123 views
Adding lighting pygame
I have created a day and nigh cycle in a game of mine by drawing a rectangle over the screen and having it's alpha change constantly. However, I obviously want to add some lighting to the game. Is ...
0
votes
1answer
53 views
Pygame Particle Emitter Problems
so I've been trying to create a basic particle system in pygame which I can later expand upon but I've run into a spot of bother creating the particle emitter. Obviously what's supposed to happen is ...
1
vote
0answers
107 views
pygame double buffering
I am trying to use double buffering in pygame. What I'm trying to do is display a red then green screen, and switch from one to the other. Unfortunately, all I have is a black screen. I looked through ...
0
votes
0answers
73 views
Game physics movement
I am trying to write some code in Pygame that will achieve smooth movement from place to another. I've been able to do some nice physics for jumping but when I need to move horizontally I am not sure ...
13
votes
2answers
515 views
Random/Procedural vs. Previously Made Level Generation
I am making a game (called "Glory") that is a top-down explorer game, and am wondering what the advantages/disadvantages of using random/procedural generation vs. pre-made levels are.
There seems to ...
0
votes
2answers
103 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 ...
1
vote
1answer
100 views
Python + Pygame - Collision problems
I'm currently developing a game in Python + Pygame and i came up with a problem with the player and the platforms. The game is a 'runner' where the player it's fixed (The 'x' position isn't variable, ...
1
vote
1answer
80 views
Lightning Effect PyGame [closed]
I want to create a Lightning Effect Like http://www.youtube.com/watch?feature=player_embedded&v=mmU2GAYGVSU for my game.
The following blog explains it briefly but I am not able to understand the ...
0
votes
1answer
66 views
PyGame sprite assistance
I've basically just started developing with PyGame and I am having trouble with the whole Sprite concept. I have been looking every where for guides on how to use it, I just can't seem to find any. I ...
0
votes
2answers
627 views
Installing the right version of PyGame
I've been trying to install PyGame for Python, and can't seem to get Python to recognize that it's there. I use Python 3.3, and have a 64-bit Windows computer, but that's really all I know. The ...
0
votes
1answer
184 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 ...
3
votes
1answer
77 views
How to make a map surface object
I'm making a 2d tile based game. In pygame I could create a map like this:
screen = pygame.display(resolution)
map = pygame.Surface(width, height)
for tile in all_tiles:
map.blit(tile)
...
1
vote
1answer
184 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
172 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
3answers
213 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 enemys to wander randomly. So I put:
enx_speed = random.randint(-2, 2)
eny_speed = random.randint(-2, 2)
in the main loop (while true: )
But that loops every ...
0
votes
1answer
116 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
146 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
508 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 ...
-1
votes
1answer
189 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
245 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: ...
0
votes
1answer
87 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
65 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
163 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
113 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
1answer
144 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
105 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
647 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
204 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
947 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 ...
2
votes
0answers
170 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
216 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
418 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
70 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
231 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
143 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
237 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
207 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
157 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 ...