Tagged Questions
0
votes
1answer
42 views
Collision detection between image layers and shapes
How can I efficiently detect collision between image layers and generated shapes?
I need a fast and comprehensive method to detect collision between rotatable image layers and generated shapes.
So ...
3
votes
1answer
45 views
How to divide sprite into smaller parts in pygame?
No i don't ask about spritesheets.
I'm working on simple game in pygame and I want to know is it possible to divide sprite into parts like head, body,leg,... to use it in collision-detection with ...
0
votes
3answers
61 views
Detecting Rectangle collision with a Circle
I have a Circle with a center point (Center_X, Center_Y) and I am detecting if a rectangle falls into it's Radius (Radius). How would I be able to perform this task? I have tried using
if (X - ...
1
vote
1answer
44 views
Problems displaying a textbox when character collides with an NPC
I'm having a problem displaying a textbox to the screen when my character's collision box collides with that of a certain NPC's collision box.
This first section of code is part of the module file I ...
0
votes
0answers
29 views
Trouble with collisions of sprites and images in a dictionary
I've been trying to make a theoretically simple game in pygame for awhile. I'm having problems with the collision of the animated player sprite and the unanimated other sprites. I tried using animated ...
0
votes
2answers
26 views
Differentiating between sprites in collision
I am creating a program similar to the classic "astrocrash" game, but there are multiple types of ammunition, each only affecting a specific type of target. The method self.overlapping_sprites() will ...
-1
votes
1answer
34 views
Collision Detection With 'jump/not smooth'' movement
my problem with the code is that i created a sprite that is able to move a tile each time when an arrow key is pressed, the problem is when the sprite moves onto a tile that has a wall on it, it still ...
1
vote
1answer
64 views
Detecting collision in python and tkinter
I have following setup: I have an archer who can shoot arrows, which are always new instances of the class arrow and I have an instance of the class blackMonster. My Question is whether it is even ...
0
votes
0answers
24 views
pygame extending sprite class collision issues
I am designing a tower defense style game in pygame. The next step for me is to detect collisions between "bullet" objects and "enemy" objects. Both objects extend pygame.sprite.Sprite, and work fine ...
0
votes
1answer
42 views
How to tell if two sprites are actually colliding and not just “touching” in pygame
Trying to make a basic platformer and having trouble understanding how to detect collisions and deal with the Sprite superclass. I was learning from a more turn-based ish game, and they were using ...
1
vote
2answers
28 views
How to check which object my character is colliding with?
I am working on collision detection for a game, so that if the character runs into an object they stop moving. As part of my solution for this, I have made two functions that iterate through a list ...
0
votes
1answer
39 views
Why am I unable to iterate through objects to check for collision
I'm trying to make a game where you can move a character around screen and I had it so that if my character ran into a picture of a tree, the character would stop moving. After getting this to work, ...
0
votes
0answers
37 views
Simple collision detection accuracy
I have a problem with collision detection precision. Collision is not detected properly because of updating ball with delta time, my code looks like following:
That is a part of my ball class:
class ...
0
votes
1answer
32 views
Pygame collision detect with PNG and rect?
I did recently ask this question, however I only got one answer and it didn't really explain enough for me. I need to check for a collision between two objects. One is a PNG image loaded in the ...
0
votes
2answers
405 views
Pygame collision detect with object and rect
Yep, I'm asking another question about this program :D
Anyway, I currently have the a prgram that creates two lines on the screen with a gap in between them and that can scroll. From here, I ...
14
votes
3answers
631 views
Detect if a cube and a cone intersect each other?
Consider two geometrical objects in 3D:
a cube aligned with the axes and defined by the position of its center and its extent (edge length)
a cone not aligned with the axes and defined by the ...
0
votes
2answers
74 views
How's this for collision detection?
I have to write a collide method inside a Rectangle class that takes another Rectangle object as a parameter and returns True if it collides with the rectangle performing the method and False if it ...
2
votes
2answers
99 views
python collision detection resolution circular dependencies
I'm working on a simple game in python (which I'm fairly new to as a language) using pygame and it seems as though python really hates circular dependencies (although I'm aware there are ways around ...
0
votes
0answers
42 views
Pygame collision detection less frequent when objects are increased
I currently experiencing an issue in pygame where whenever i increase the number of objects e.g. platforms, rocks
for a in range(150):
rock = Rock(0,0)
OR incresing the range which they spawn ...
0
votes
1answer
87 views
Weird collision detection with Snake Game
I am experiencing a weird collision detection bug that I am failing to find. I am building a small snake game, and as tradition goes, I need the snake to die when he collides with himself. So I told ...
0
votes
1answer
116 views
Circle and line collision detection in python tkinter
I writing a python program in which a circle bounces off of user drawn lines. There are multiple circles that bounce off the wall. For each one, the shortest distance from the center of the circle and ...
0
votes
2answers
75 views
Pygame Sprites doesn't detect collision
I've made a start menu and a menu screen. The start screen has a single Button Sprite. After clicking, it creates the correction animation then goes to menu screen as expected. However, this menu ...
1
vote
0answers
54 views
Get the pixels which are colliding with the Surface
Right now, I have a collision detection in pygame which checks if two rctangles overlap or not...what I am trying to do is check the transparency of a the surface and if the alpha value is less then ...
1
vote
1answer
129 views
PyGame Collision Detection - Platformer Freezing
I've written up a platformer with some healthy referencing to various sources. The ultimate idea of my platformer is to be able to traverse lines that you draw with your mouse. Unfortunately, I ...
0
votes
2answers
294 views
Pygame - Collisions With Floor/Walls
Hello I am currently making a survival shooter but cannot find any way on how to do my collisions! I am trying to make the player collide with the floors but with no success. Here is an image of the ...
0
votes
0answers
67 views
Get coords of GL_QUAD for collision detection?
I have a GL_QUAD which is basically a big field that the player is able to walk on. However, I want the player to have the abilty to 'jump,' meaning when he returns to his original y position he must ...
0
votes
1answer
223 views
Platformer Collision in Pygame
I was trying to write a platformer in Pygame, but for the past few weeks I've been stuck on the collision detection between the hero and the platform. Here are my classes:
class Platform(object):
...
1
vote
1answer
100 views
Pygame image collisions leaves gaps between images visually
Here I am freezing the two images as soon as they collide. The lollipop starts from the top left and the bear starts from bottom right. They collide in the middle. My positions tell me that they are ...
0
votes
2answers
108 views
Loop through collision detection with multiple processes
I'm using python to write an ideal gas simulator, and right now the collision detection is the most intensive part of the program. At the moment though, I'm only using one of my 8 cores. (I'm using ...
0
votes
1answer
68 views
Can't get Pygame Collision detection to work
I'm using Pygame and Python 3.2 to make a game. I must find out how to use collision detection so the player (ballpic) can pick up the items.
Here is my code:
from pygame import * #import pygame
...
0
votes
1answer
57 views
Weird bug in pygame
Hi there I am currently working on a side on-platformer.
I am experiencing a weird issue when I jump from one platform and to another it works fine. However whenever I jump from one and hit the ...
0
votes
1answer
97 views
Pygame Collision Detection: AttributeError
I've been banging my head against this for a while. I am trying to make a game with PyGame and I got up to the collision segment and have been stuck for a while and have checked a few threads.
This ...
3
votes
6answers
383 views
Detecting collision when rotating
I have a chain of squares represented in pygame. I have some code that lets me rotate parts of the chain, as follows.
#!/usr/bin/python
import pygame
def draw(square):
(x,y) = square
...
0
votes
2answers
801 views
Pygame collision detection
So I am trying to create a puzzle platformer game with Python and Pygame, but I'm having a little bit of trouble. How do I make a collision detecter when I am using a blitted image for the main ...
-2
votes
1answer
55 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 ...
1
vote
2answers
417 views
Add collision detection to a plattformer in pygame
I'm working on a small platformer game in which you place blocks to make a level, then play it.
I got gravity, jumping, and left and right movement.. but I am not sure how to make the player collide ...
1
vote
1answer
135 views
Making sprites bounce off of each other
To download the code, follow the link:
Background:
So I've been going through pygame tutorials since I'm new to it and I found Eli Bendersky's well-known tutorial. I was going through part one and ...
1
vote
1answer
145 views
Pygame - Getting a rectangle for a dynamically drawn object
I am writing a simple Pygame tutorial for an upcoming book and I am sort of blocked in this issue here. I have two classes, a ball (bola) and a paddle (raquete). The ball sprite comes from an image ...
0
votes
0answers
133 views
How to assign object independent collision detection
I'm trying to get ball objects on the canvas to collide, and move appropriately. I have some extra movement vars that are not important for my question, but I'd like to keep them the way they are. My ...
0
votes
1answer
67 views
Pygame Collision on Rect
I'm a student in Computer Programming at my high school and really need help to make the square an obstacle that ships can't enter and bullets disappear once you shoot at the square also for the ...
1
vote
1answer
120 views
Pygame Sprite can jump but can't walk
I've been working through this online tutorial on Pygame (Python Version 3.3.1), and have come to a point where my sprite can jump, but can walk only a few pixels in either direction. I'd really like ...
0
votes
1answer
118 views
Testing for pygame sprite collision
I have been going through some pygame tutorials, and I have developed my own code based off of these tutorials. It is as follows:
#!/usr/bin/python
import pygame, sys
from pygame.locals import *
...
0
votes
1answer
472 views
Python | Pygame | Sprite Collisions
We are making a game in in which a player walks down the street and shoots multiple enemies (robots). We have created a bullet sprite that shoots every time key <D> or the <RIGHT_ARROW> ...
2
votes
1answer
207 views
Separating Axis Theorem in Python/Pyglet
I'm trying to make a (sort-of) clone of Asteroids in Python using Pyglet. I figured I'd try to get a little fancy and implement the separating axis theorem to do collision. I got it to work, but the ...
0
votes
1answer
284 views
Collision in pygame
I'm trying to add collision into my game but have run into a problem.
The collision works fine horizontally without gravity, it stops where it should and all that, but when I add gravity it freaks ...
0
votes
1answer
1k views
how does collide.rect work in pygame
I'm having some trouble understanding how colliderect works with sprites. I have a good idea about it, but whenever I try to implement it into my game, I just get the error message ...
1
vote
1answer
293 views
Pygame - Entity movement limitations - collison detection
Ok so I have an entity that walks back and forth between two positions that right now are pixel locations shown below:
if self.rect.left == 96:
self.right_dis = False
if ...
2
votes
2answers
815 views
How do I set collision detection for Pong in Pygame
I am building a Pong clone in Pygame. I can't figure out how to add collision detection to the ball and paddles so the ball will bounce off the paddles. How can I do this? How can I have the ball ...
0
votes
1answer
246 views
Python billiards collision response some angle problems with my formula
This is my collision response code for a billiards simulation of 2 moving balls colliding. I used newton's laws of equation and then parametrised the components of the velocity vectors,
Alpha is the ...
0
votes
1answer
404 views
Pygame Collison Detection
MY PROBLEM:
At the point I'm at in my game I want to add a couple features like double jumps, wall jumps, etc.
However I've run into a problem with my collision detection and I can't seem to ...