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
81 views

Strange collision in Breakout [closed]

My Breakout game works fine so far, but I struggle with the collision detection... Well... just with the collision from the ball with the brick... Here's the relevant code: List<Brick> ...
0
votes
1answer
85 views

How to architect collision detection in SFML

I have a pretty simple game engine that I'm making for a 2d platformer game. I don't want it to be super advanced, but it does have some basic properties. Most important to this question is a class ...
0
votes
2answers
63 views

Collision detection in seemingly random locations [closed]

I have a square that moves around with user input and should return to top left of screen when it collides with one of the rectangles on the screen. It works fine when the the rectangles are not ...
0
votes
0answers
59 views

Non-rectangular hitbox methods in XNA

I'm creating a 2D top-down RPG, and many of my buildings/scenery have non-rectangular corners to the textures. Does anyone know a good way to create circular/triangular/polygonal hitboxes, or is too ...
6
votes
2answers
317 views

Triangle-triangle continuous collision detection

I am making a 3D game engine and I use continuous collision detection. I am using Sphere-Trees to cull primitive collision checks to a minimum. However, I'd like to perform continuous ...
8
votes
2answers
317 views

How can I prevent rigid bodies from moving through each other using Unity's built-in physics?

I'm trying to create a game where objects can be dragged, but I'm having trouble with the physics. With rigid bodies that have similar masses, they sometimes push through each other when dragged and ...
1
vote
1answer
177 views

Player Movement Systems

I am working on a project were in class my group of students help produce a video game. We are creating a 2D platformer and was trying to make a pixel based system collision witch fell through. Now I ...
8
votes
1answer
449 views

How do I make a curved surface out of rectangular blocks?

For a Peggle-like game, I want to make blocks that follow a curve, like this: The blocks would then disappear as the ball hits them. I managed to draw some horizontally, but I'm having trouble ...
0
votes
1answer
29 views

Ground hitting system [closed]

I want to know how to make character hit ground and lose health. For example: when character is falling of one meter he losing only a small part of his health, and when he's falling of 10 metters he ...
4
votes
1answer
195 views

How do I simulate a trampoline?

I'm quite new to game development. I was pretty impressed with the elastic effect I saw in this flash game when the ball hits the trampolines and I'm wondering how to recreate it. I've done some ...
0
votes
2answers
91 views

Collision detection via adjacent tiles - sprite too big

I have managed to create a collision detection system for my tile-based jump'n'run game (written in C++/SFML), where I check on each update what values the surrounding tiles of the player contain and ...
2
votes
1answer
91 views

C++ FPS game collision detection with partitioning system or physics engine?

I'm working on a small FPS game (as a hobby and for learning purposes, nothing else) built with C++ in OpenGL (from scratch). Documenting online on the kind of strategy someone would approach with ...
0
votes
0answers
71 views

Interactions between camera and procedural terrain

QUESTION REWORKED I need to update every frame camera position along a surface with hills and drops. In this picture you can see a particle of the surface terrain (just one triangle) and a sphere ...
1
vote
1answer
146 views

Strange collision behaviour in 2D game even though the collision is very basic [closed]

I have a player ship (cube) and some enemy laser projectiles. When the player ship has position X values greater than 1, collision with the enemy projectiles occur but when it has lower X values, the ...
0
votes
0answers
69 views

Smooth circular collisions with edges/collision boxes [C# + XNA]

So, me and a friend are working on our top-down perspective 2D game, and have come to work on perfecting our collisions. In its current state our player sprite is colliding with walls, but is ...
2
votes
2answers
117 views

Collision detection - make sure the player touches the object exactly

I know this is really something I should be able to figure out on my own, but a solution is evading me. Okay, here are a few relevant parts of my code. bool Game::Col(int x1,int y1,int w1,int h1, ...
0
votes
1answer
70 views

CDK (as3) false positives when using it with array elements

I'm having problems when using the CDK (Collision Detection Kit) with elements in an array. It keeps getting me false positives of collision. I'm making a game in which the player controls a “ship”, ...
2
votes
1answer
108 views

When is a quadtree preferable over spatial hashing?

I'm making a 2d platformer with lots of objects at the same time. They're all AABB collision detected. I first tried a quadtree to decrease the number of of objects to check, tried a few different ...
2
votes
1answer
133 views

Libgdx - Collision position - Box2D

I'm actually developping my own game but i'm facing a little problem. I trying to figured out how to get the position of a fixture (collision) between two entities. For example this : ...
-3
votes
1answer
110 views

Simple collision detection implementation [closed]

I'm making a game with C++ where the program extracts the lines out of an image (via openCV), stores them in an std::vector< std::vector< int > > and the builds a tile map out of it which is ...
-1
votes
1answer
71 views

Grid based Collision Detection between circles [duplicate]

I am working on a 2d arcade game where I have 5 types of circles with different sizes: The ship, the missiles, and 3 types of monsters. This is what it looks like: Currently I'm using brute force ...
2
votes
1answer
119 views

At same positioned game objects collision detection

In my game, I am creating two game objects at same position using Instantiate statement. Each generated object has box collider attached. So I want to detect collision between them so I write ...
0
votes
0answers
35 views

Collision detection with many moving objects and an unknown world size [duplicate]

At present I am using the simple O(n^2) algorithm whereby the bounding geometries of each pair of game objects is tested for collisions. The result is that I can only handle around 100 game objects ...
0
votes
0answers
228 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
2answers
123 views

Box2D Libgdx removing bodies in case of simultaneous collisions

I am making a clone for the BreakOut game. I'm using Box2D and Libgdx for it. In the game, one scenario is that there could be 2-3 balls at one time. Now the problem occurs when 2 or more balls ...
0
votes
0answers
42 views

Box2d - Allow object to pass but still report collision [duplicate]

I am creating a laser which is a dynamic body with its own collision filtering. I want it to not collide, as it does not currently but I want it to still report the collision or when the two overlap. ...
3
votes
1answer
75 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
0answers
66 views

Collision - Per Pixel and Rectangle Based, Combined

UPDATE:i found the error in my calculation the problem was that i needed to consider if the image is rendered flip or not to fix it just need to rub from the opposite side of the sprite I am currently ...
1
vote
2answers
196 views

2D AABBs and resolving multiple collisions

Okay, so this is a problem I've been trying to figure out for quite some time. Mine is a 2D platformer game with a world made up of (usually) immobile tiles and mobile sprites, both of which use AABBs ...
0
votes
1answer
205 views

How to implement uniform grids

Up until now, I implemented all-against-all collision detection in my games. It worked fine. But I reached a point where implementing this kind of collision detection, makes the game run poorly, ...
18
votes
6answers
2k views

How to optimize the distance function?

While developing a reasonably simple RTS-like game, I noticed my distance calculations were causing an impact in performance. At all times, there are distance checks to know if a unit is in range to ...
0
votes
0answers
133 views

NavMesh agents pushing other NavMesh Agents in Unity Pro

Using the NavMesh system in Unity, I created pathing system for my player character as well as the enemy AI. When a group of enemy NavMesh Agents surround my player character, they can be pushed out ...
2
votes
1answer
91 views

How do I compute the point of a triangle-ray intersection?

I have a line (the direction vector of the player) and a triangle representing the face of a model (so composed of 3 points). I can't find the mathematical operation to check if that vector is ...
1
vote
0answers
52 views

Does anyone know a good knockback algorithm? [closed]

I was just wondering if someone had a good knock back algorithm for a top down shooter game. I was hoping for not as much as a knock back but more of a push. that would be great.
0
votes
1answer
119 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
1answer
159 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 ...
-1
votes
2answers
100 views

Java Tilemap Collision

I have tilemaps represented by values from 0 to 4. How can I make the player collide with tiles represented by 3 and stop the player from passing through it ? Here is my code for the player and ...
0
votes
1answer
239 views

OBB Collision Resolution: Jittering with Long Rectangles

I have been working on a physics simulation module. Almost everything works properly, but I am having an issue, which I have demonstrated in the following video. http://youtu.be/2L17y9Lme0Q As you ...
1
vote
1answer
46 views

A Sensor’s ContactList Keeps Old / Ignores New Contacts, When That Contact Is still

Okay this is a hard one to explain so I’ll try my best. Basically every time my enemy class updates, it runs a SightCone Sensor Contact List test, so this is every single frame it checks for all the ...
1
vote
1answer
127 views

How to prevent a sprite to move in an angle that will lead to collision

I have two sprites that can move in any angle. The sprites are rectangular. I created bounding boxes for both the sprites. These boxes rotate whenever the sprite rotates. They always surround the ...
6
votes
1answer
126 views

Separating axis theorem with multiple polygons?

I am attempting to implement the separating axis theorem in C#. I have a function that can calculate the minimum translation vector between two polygons. However, I can't seem to create a function ...
0
votes
2answers
78 views

Floating point precision issue with Box2D

I'm using Box2D and I am putting edge tiles as b2Bodies so that the tile world can have physics: The problem is that there are 3 b2_kinematic bodies under the player right beside each other. Every ...
1
vote
2answers
239 views

Calculating wall angle and sliding in 2D

Got a new project recently where I don't use any physics engine, but it requires some basic phyiscs. Basically it's a 2d "top-down" game type. I would like to add a smooth wall collision which feels ...
1
vote
0answers
31 views

Calculating contact points with SAT [duplicate]

after detecting collision between two convex shape by using separating axis theorem and calculating MTV, how can i calculate the contact points ?(for applying torque to the rigid body).
3
votes
1answer
100 views

Directional, Triangular Collision Detection in Pygame [duplicate]

I am trying to create a game in Pygame, with Python 3, and am trying to figure out an algorithm that will tell me which direction a rectangle is colliding with a rectangle, so that I can push it back ...
0
votes
1answer
84 views

How to loop through objects in class (XNA)? [closed]

In my game I have an Enemy class, and in that I have a constructor which I use to make Enemy objects. How do I add all Enemy objects to a list or loop through all of them using a foreach loop? I ...
2
votes
1answer
97 views

Collision detection in libgdx

I am currently writing a little zelda like game and have a little bit of a problem with collision detection. It works but the the character stands to far away from the object. Here is my player ...
1
vote
2answers
109 views

Detecting collision of two sprites that can rotate [duplicate]

I have a problem with collision detection in a 2D Java game. Normally, what I would do is create a getBounds() method for an object that can collide with other objects. This method would return a new ...
0
votes
2answers
133 views

How to get surrounding tiles in a tile array

I've created a tiled map that holds two layers, one for the tile type, and the other for whether it is solid or not. I plan on creating very big maps, and checking every tile seems like it would slow ...
0
votes
1answer
142 views

2D Tiled Map - Small tiles or big tiles with pixel-precise movement

I am using Java - LWJGL - Slick2D . I have tried to do a proper collision detection with 32 x 32 tile size but failed three times. I just cant get it to work! I found a youtube video that was using ...