Collision detection is the determination of whether or not two or more entities make contact with each other during gameplay.

learn more… | top users | synonyms (2)

0
votes
1answer
2k views

Android Bitmap: Collision Detecting

I am writing an Android game right now and I would need some help in the collision of the Pawns on screen. I figured I could run a for loop on the Player class with all Pawn objects on the screen ...
0
votes
0answers
29 views

Help slope tile collision platformer (XNA/C#) 2D

I have been creating a platform game in C# and XNA, everything works pretty well least the slope (down left and right). This is the project that I have so far. PlatformGameEngine.rar When the ...
0
votes
1answer
190 views

Game object position issue in unity3d

I have a set of objects placed on the same layer where all the objects are invisible except one .When i drag an object in to a selected area the current dragged object get destroyed and the object ...
29
votes
6answers
2k views

Hexagon collision detection for fast moving objects?

A object has a position and a speed vector. Usually only the position is used to check if two objects collide, this is problematic for very fast moving objects as it can happen that the object moves ...
0
votes
0answers
29 views

2D AABB vs AABB side of collision and collision depth

I realize there have been a multitude of questions involving 2D AABB vs AABB collision, but the questions and responses always avoid the simple questions that make it difficult. To keep things ...
3
votes
1answer
182 views

Jelly ground collision

For fun I am trying to replicate the mechanics from The Floor is Jelly. So far I have successfully created "jelly islands/blocks" which are represented by an array of points and then drawn by using ...
8
votes
5answers
4k views

How do I detect the direction of 2D rectangular object collisions?

After this question, I need some more help. How can I find out which side of a rectangle a collision came from and react accordingly? The blue arrows are the paths that some circular objects ...
1
vote
1answer
70 views

2D Collision : detection and design

So, listening to this very smart piece of advice, I've already completed a basic Tetris game. Moving on, I started a small breakout. But suddenly : a nightmare came. Collisions. Since I've been ...
2
votes
1answer
160 views

Minkowski Portal Refinement collision detection algorithm

Preface: While I was learning the basics of collision detection, I read in various places that the SAT and GJK algorithms don't natively return contact points. So I decided to research the MPR ...
2
votes
0answers
202 views

How do I compute the angle between a pixel on an irregular curve and a circle colliding with it?

I'm building a custom physics engine to accompany a level-editor. This image shows how the level-editor outputs levels: Now, some explanation is in order. The curve is defined by the red points. ...
0
votes
0answers
50 views

Is this 3d hit detection 'good enough'?

I'm mucking around in Python and PyGame with a 3D 'engine' of sorts - mostly just translating a series of [x, y, z] lists to [x, y] positions and drawing lines between them as fast as I know how :) ...
0
votes
2answers
483 views

Java collision detection and player movement: tips

I have read a short guide for game develompent (java, without external libraries). I'm facing with collision detection and player (and bullets) movements. Now i put the code. Most of it is taken ...
0
votes
1answer
46 views

Handle Entities & Collision in large numbers [on hold]

I am creating a simple 2D maze game and I am a little confused about entities & collision detection. At the moment, my entity class is an abstract class containing position, velocity, sprite and ...
0
votes
1answer
515 views

How do I add a Rigid body and a box collider component to a Texture2D?

I am making a snake game. I'm basing it on a basic tutorial game, which does no collision detection, wall checking or different levels. All snake head, piece, food, even the background is made of ...
0
votes
2answers
78 views

Collision detection enhancement

I am developping a spaceinvader-like game. There comes the problem of how to handle collision detection. At first I was doing like that : forEach(fireBall : fireBalls) { forEach(stormTrooper : ...
1
vote
2answers
117 views

Help finding time of collision

I am making a simple game right now and am struggling with collision response. My goal is to someday be able to turn it into a 2D platformer but I have a long way to go. I am currently making this in ...
0
votes
1answer
41 views

LibGDX Bounding Rectangles

I'm creating some rectangles surrounding my sprites for my player and bullet class to detect collisions with the overlaps method in Intersector class of LibGDX. I have a question: When I instantiate ...
1
vote
1answer
20 views

Libgdx--how to store every single point drawn using touchdragged?

Basically i am trying to detect line collision. The problem is when intersection occurs quickly(touch dragged is done quickly like fling), the collision is not detected. It seems as if 'touch dragged' ...
1
vote
1answer
134 views

How could I implement 3D player collision with rotation in LWJGL?

I have a problem with my current collision implementation. Currently for player collision, I just use an AABB where I check if another AABB is in the way of the player, as shown in this code. (The ...
1
vote
2answers
84 views

Collision detection between triangle and polygon

I have some difficulties to understand how to be sure if there is a collision between a space ship (black) and an asteroid (in blue). A space ship is placed on a case and an asteroid comes from the ...
2
votes
1answer
52 views

How do I detect a line collison in LIBGDX?

I am drawing a continuous line using Pixmap. I want to check for a collision / intersection of my line with the already drawn line.
2
votes
1answer
60 views

2D collision of thrown objects in Unity

I am currently working on a game inspired by traditional 2D Zelda games ("Link To The Past", etc.) in Unity using the 2D settings. I am looking for the best way to handle objects that the character ...
3
votes
2answers
2k views

2D Collision masks for handling slopes

I've been looking at the example at: http://create.msdn.com/en-US/education/catalog/tutorial/collision_2d_perpixel and am trying to figure out how to adjust the sprite once a collision has been ...
0
votes
1answer
305 views

Using PhysX, how can I predict where I will need to generate procedural terrain collision shapes?

In this situation, I have terrain height values I generate procedurally. For rendering, I use the camera's position to generate an appropriate sized height map. For collision, however, I need to have ...
1
vote
0answers
99 views

A problem with collision when a sprite changes size (Phaser framework) [closed]

I have a sprite in my game that changes size at certain points in the game. It changes size via the sprite.body.setSize method. Unfortunately, it seems that the sprite is unaffected by objects that it ...
4
votes
5answers
5k views

Why does my rectangle-circle collision handling misbehave in this fashion?

Ok so this is for a small uni project. My lecturer provided me with a framework for a simple brickbreaker game. I am currently trying to overcome to problem of detecting a collision between the two ...
2
votes
1answer
62 views

Why do my Box2D collisions fail when I have multiple fixtures on one body?

I'm creating my first libgdx / Box2D game where a player moves around using a mouseJoint. My player has two fixtures, "main" and "question". For some reason when I have these two fixtures, my player ...
0
votes
1answer
64 views

c++ - collision detection/resolution clipping

I'm trying to implement a collision detection system, and it is working for the most part, no overlapping (or at most very little overlapping) of characters, and wall collisions. The problem is that i ...
0
votes
1answer
889 views

Slope polygon collider 2D causing box collider 2D to 'bump' while sliding on it

I'm doing procedural terrain generation. So far I've created the mesh, and attached a 2D polygon collider to it. The terrain is made up of hills going up and down. After doing so, I put a 2D rigid ...
0
votes
1answer
370 views

Swinging a sword in Xcode with Sprite Kit

I'm working on making an RPG in Xcode, and I'm having a major gameplay issue when it comes to having my character swing his sword in a way that is realistic and gameplay compatible. Right now, when ...
2
votes
1answer
163 views

How to impale and stack targets correctly according to the collider and its coordinate?

I'm making another simple game, a catch game, where a spawning target game object must be captured using a skewer to impale it. Here how: At the start, the falling object (in red) will fall in a ...
2
votes
2answers
182 views

Sprite Kit - containsPoint for SKPhysicsBody?

I have a ball bouncing around the screen. I can pick it up and drag it onto a "bucket". When my touches finish, I use the containsPoint function to check and see if I have dropped the ball onto the ...
2
votes
2answers
429 views

How can I optimise collision checks for a large number of AI units?

Let's say I got 100 Orcs in my 3D world and they all aim to kill each other. That means for every 1 Orc I have to check for collision with the 99 others. That will give me 99^2 which is about 10,000! ...
0
votes
0answers
17 views

How do I get the impulse of a collision from Box2D in LibGDX?

I am developing a game using LibGDX and Box2D. I want to get the force or the impulse when two bodies collide, but I can't find the right way to do that. How can I use a ContactListener to get the ...
1
vote
2answers
51 views

Collision between Mesh Plane and 2D Sprite

I've just recently started programming using Unity and made a couple of games with it, I'm trying out more and more advanced stuff as I do more games, but right now... I'm trying to make a game ...
0
votes
2answers
91 views

Optimizing Collision Detection in a 2D Game

I am optimizing my "little" Java (LibGDX) shooter game, and perhaps unsurprisingly, collision detection is a "bottleneck"; I've kind of reached my performance goals already, but I want to tweak the ...
1
vote
1answer
81 views

Resolving penentration after collision using Separating Axis Thereom

I implemented collision detection in my game using SAT. The detection works, but I'm trying to use the algorithm to figure out the penetration vector of the two OBBs and push them apart (before doing ...
1
vote
2answers
423 views

Sprite collision with color?

Is this possible? To elaborate, I am making a PacMan offshoot. Essentially it is a "zoomed in" version of the game, but the board is randomly generated. I have 11 .png files each to be used as a ...
2
votes
0answers
534 views

Why does my RigidBody collision fail depending on which entity is moving?

I am working on a UDK project and have a collision problem. I have a Crate which is a kActor with RigidBody physics and my player who is a Pawn. When my player moves and collides with the crate, the ...
2
votes
1answer
289 views

How do I create a player movement system in Farseer?

My group of students is helping produce a a 2D platformer. We tried making a pixel-based collision system which fell through. Now I am trying this physics engine on for size and see new ways to create ...
0
votes
1answer
309 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 ...
0
votes
2answers
377 views

Collision detection with multiple polygons simultaneously

I've written a collision system which detects/resolves collisions between a rectangular player and a convex polygon world using the Separating Axis Theorem. This scheme works fine when the player is ...
1
vote
1answer
59 views

How can I stop my collision detection from registering multiple times per frame?

I am working on a side-scroller shooter right now. Everything is working fine along with the collision detection however, my problem is that the collision triggers my health deduction code multiple ...
0
votes
0answers
32 views

Seeking Advice: Collision with JBox2d for Top-Down or Isometric Maps

I Hope I can make this as clear as possible! Currently working on an action RPG game, very early stages, more just the basic ideas down and written in. So i'll start on with my setup: Using Java ...
0
votes
2answers
283 views

3D collision physics. Response when hitting wall, floor or roof

I am having problem with the most basic physic response when the player collide with static wall, floor or roof. I have a simple 3D maze, true means solid while false means air: bool ...
1
vote
2answers
442 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 ...
1
vote
1answer
140 views

How do I implement melee hit boxes for a top-down game?

For a 3D top-down game, how should I handle collision in melee combat? My game has no targeting system, so I can't use a simple distance check between attacker and target. What I am thinking is have ...
0
votes
1answer
131 views

Using Bullet physics engine to find the moment of object contact before penetration

I would like to use Bullet Physics engine to simulate the objects in 3D world. One of the objects in the world will move using the position from 3D mouse control. I will call it "Mouse Object" and ...
0
votes
1answer
395 views

Getting a pixel of Sprite at the cursor position in Unity

Summary: I've been trying to figure out a way to use simple box colliders as a nice and efficient "first pass" collider. For the "second pass", I want to check that the area clicked has an alpha value ...
0
votes
1answer
64 views

Best way to go about collision between rectangle and bool array containing pixel data?

Basically, if I have an array along the lines of bool[] collision; Filled with a value for each pixel in the sprite I am checking collision against (pixel 1 = true, pixel 2 = false etc), how do ...