Skip to main content

Questions tagged [collision]

In collision detection problems, the challenge is to determine when shapes intersect each other.

5 votes
2 answers
2k views

QuadTree for collision detection

I was recently working on a game using the SFML library, Later on, I experienced performance issues due to collision detection. I have been told to use a QuadTree ...
MORTAL's user avatar
  • 3,278
11 votes
1 answer
586 views

Bounding volume hierarchy

I'm building a bounding volume hierarchy in Golang. I can tell my code works because I did some test on it and it gives the same results as the brute force implementation (brute force is to test all ...
user avatar
5 votes
2 answers
474 views

Obstacle-avoiding AI

I have made a game in Java that involves two players to fight each other with spaceships. For one player mode, I have programmed a simple AI to avoid allies and asteroids and go straight towards the ...
Blue's user avatar
  • 574
3 votes
6 answers
703 views

Conditionally eliminating one of two colliding bodies

I like to explicit return function even for void functions to reduce the use of if-elses, like this code snippet: ...
alexpfx's user avatar
  • 524
4 votes
1 answer
2k views

Check if specific key exists in 2-dimensional array

I am writing a "collision detection" in PHP and want to check if a specific "area" is still free in the two-dimensional target array. I use the following code to do that, but I think there might be a ...
flomei's user avatar
  • 173
5 votes
1 answer
437 views

Platformer with collisions

Today I started to build my first platformer, first time working with collisions and stuff. Now, surprisingly, everything seems to work, but since this is my first time creating a platformer and I'm ...
The Coding Wombat's user avatar
2 votes
1 answer
74 views

Check for collision with side of screen

I thought of a program where you move a square with the arrow keys. I created it and asked a question about it on Stack Overflow. I copied the last code block of the accepted answer and tried to ...
The Coding Wombat's user avatar
9 votes
1 answer
13k views

Line segment to circle collision algorithm

I've written a function (in Python 3) which computes if a line segment (constraint) and a circle (body) collide, and returns the point of intersection (closest point to the centre of the circle): <...
Tochi Obudulu's user avatar
1 vote
1 answer
89 views

FPS efficiency for 'attack counter'

I have a code snippet which I wish to improve to increase my program's FPS, but as a beginner in JavaScript, I do not know how. I know the problem, which is the fact my counter mechanism used to delay ...
Colourfit's user avatar
  • 185
7 votes
1 answer
944 views

Quad Tree and Collision Detection Implementation

I have an implementation of a quad tree and abstract collision detection classes. The code works but looks very ugly, but I don't know what I could change to make it better. The reason I used two ...
T_01's user avatar
  • 173
7 votes
1 answer
413 views

2D Platformer Collision Detection/Resolution

I am working on a 2D tile based platformer and was hoping to get someone to review my collision detection. I've only included the X collision check since the Y is essentially the same. Any suggestions/...
Reyer Swengel's user avatar
4 votes
1 answer
385 views

Ray→plane and ray→quad intersection

This checks the intersection between a Ray and a Plane and between a Ray and a ...
MaiaVictor's user avatar
  • 1,101
3 votes
1 answer
180 views

Weeding out triangles for triangle-triangle collision detection using a spatial hash

I am implementing a multi-phase collision detection system whose final collision check is checking the triangles of one shape against those of another. As the number of triangle-triangle comparisons ...
ThomYorkkke's user avatar
8 votes
1 answer
9k views

Collision-detection for an SDL game

I am working on a simple SDL game in C++. I want to make my collision detection implementation better. Here's the complete project: ...
JohnBobSmith's user avatar
2 votes
2 answers
1k views

Thread, handler and activity structure for a bouncing ball animation

This is a custom MyActivity class with two custom views (bar and a ball): ...
Кристиян Кацаров's user avatar

15 30 50 per page
1
4
5
6 7 8