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

learn more… | top users | synonyms

12
votes
3answers
712 views

Overlapping rectangles: Interview Question

Got the following question in a technical interview today (for a devops/SRE position): Write a function which returns true if the two rectangles passed to it as arguments would overlap if drawn on a ...
2
votes
1answer
104 views

Java Pong Game Collision between bat and ball

I have a very simple Pong game that I've built in Java. The code is quite long so I've decided to focus this question on the collision that occurs with the ball and the bat and also the effects in the ...
1
vote
0answers
82 views

Collision System in Pong-like game - How good is this code? (Blitzmax)

I am writing a game like Pong. Therefor I am using an entity system approach, so I use component based design. The hardest part until now was to write the collision system. As I just began with the ...
3
votes
1answer
74 views

Collision detection accuracy

How do you guys think I can improve the code for collision detection on my website asteroidfield.eu5.org? The current code is var dx = Math.abs(c1.getcx() - c2.getcx()); var dy = Math.abs(c1.getcy() ...
2
votes
1answer
159 views

How to improve Collision Detection in Bricks in BreakOut Game [closed]

I've done my first BreakOut Game while completing an assignment for Stanford University CS Online Course for java. However I noticed during play testing that when the ball sometimes hits a brick ...
0
votes
1answer
114 views

My second attempt at canvas spatial grid collision? Did I get it?

After posting my first question and my first attempt which you can see here, My first attempt at canvas spatial grid collision? Please be honest! I have re-written it to try and implement what the ...
3
votes
1answer
132 views

My first attempt at canvas spatial grid collision? Please be honest!

The code, $(document).ready(function() { window.addEventListener('keydown', keyPress, true); // event listener for keyboard presses function keyPress(evt) { if(engine.activeBlock) { // block is ...
1
vote
1answer
79 views

Breakout-like game in JS

I've made a small breakout game, so far with one level. My plan is to expand it so that it has a level editor, but for now I wanted to make sure that everything is currently looking well-designed. I ...
5
votes
1answer
227 views

Collision-checking optimizations

If I'm working in a 2D environment and have hundreds of objects, brute force collision-checking would be out of the question, but would my method below work? For example, let's say I have a ...
2
votes
1answer
5k views

Java Slick 2D Collision Detection Methodology

I have a collision detection for terrain setup (non-terrain is handled with a quadtree I implemented apart from this) and I was wondering how others have done it compared to mine and what I could ...
1
vote
1answer
154 views

Does this intersection algorithm work like it's supposed to?

and can I make it more efficient? It's to test the collision between a ray and a sphere. float BoundingSphere::Intersects(Ray ray) { D3DXVECTOR3 direction = ray.Direction(); D3DXVECTOR3 vec = ...