The determination of whether or not two or more entities make contact with each other during gameplay.
0
votes
2answers
2k views
Breakout collision using 2D Rectangles?
Here is my code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
namespace BreakOut
{
class Field
{
public static ...
-5
votes
2answers
371 views
two balls stick together in a pool game? [closed]
when multiple collisions occur between balls..sometimes they stick together..mostly in cases of either of the balls having high velocity..can somebody explain pls
18
votes
7answers
7k views
most efficient AABB vs Ray collision algorithms
Is there a known 'most efficient' algorithm for AABB vs Ray collision detection?
I recently stumbled accross Arvo's AABB vs Sphere collision algorithm, and I am wondering if there is a similarly ...
14
votes
5answers
4k views
Collision Resolution
I know quite well how to check for collisions, but I don't know how to handle the collision in a good way.
Simplified, if two objects collide I use some calculations to change the velocity direction. ...
13
votes
2answers
717 views
Where should collision detection logic be placed?
I am developing a small 2D game engine. The characters have a paint method which currently does the following:
Calculate the new position of the character as per its speed, etc.
Update the collision ...
9
votes
2answers
1k views
Continuous Physics Engine's Collision Detection Techniques
I'm working on a purely continuous physics engine, and I need to choose algorithms for broad and narrow phase collision detection. "Purely continuous" means I never do intersection tests, but instead ...
5
votes
3answers
3k views
Efficient Tile-based collision detection for a lot of squares?
currently I am working on my own take of a tile-based game (think Terraria, but less fantastical (I think that's a word? Sorry if it isn't)).
Anyway, I currently have collision detection working ...
4
votes
2answers
792 views
Correct order of operations in a platformer game loop
I've run into an issue with my Mega Man engine, and the structure of my game loop is making it very difficult to fix. With Rush Jet, or any falling platform, Mega Man needs to stay attached to the ...
2
votes
3answers
642 views
Coarse Collision Detection in highly dynamic environment
I'm currently working a 3D space game with A LOT of dynamic objects that are all moving (there is pretty much no static environment). I have the collision detection and resolution working just fine, ...
9
votes
2answers
368 views
Boat passing under a bridge in a 2D tile based RTS
I'm writing a 2D tile based RTS. And I want to add a 'pseudo 3D' feature to it - bridges over the rivers.
I havent't start any coding yet, just trying to think how it fits the collision detection ...
5
votes
3answers
5k views
2D Side Scrolling game and “walk over ground” collision detection
The question is not hard, I'm writing a game engine for 2D side scrolling games, however I'm thinking to my 2D side scrolling game and I always come up with the problem of "how should I do collision ...
2
votes
2answers
852 views
Projectiles in tile mapped turn-based tactics game?
I am planning to make a Laser Squad clone and I think I have most of the aspects covered. But the major headache is the projectiles shot/thrown.
The easy way would be to figure out the probability of ...
8
votes
1answer
425 views
Are there well-known algorithms for fitting a polygon to an arbitrary shape?
I'm using the Chipmunk physics engine to make the levels for a 2D C game. I'd like to be able to fit a polygon to an arbitrary shape to serve as the collision mask. Given a black and white collision ...
5
votes
2answers
1k views
How can I implement rectangle collision response?
I am working on a game in JavaScript and my current implementation of collision uses the shortest distance to push the intersecting object away, which isn't always correct. I've made this diagram of ...
4
votes
5answers
443 views
Collision detection performance problem
Using python and pygame I've built a collision detection system according to the instructions in this YouTube tutorial.
This is updated 40 times per second and controls movement and collision ...
4
votes
2answers
819 views
Sliding collision response
I have been reading plenty of tutorials about sliding collision responses yet I am not able to implement it properly in my project. What I want to do is make a puck slide along the rounded corner ...
2
votes
1answer
1k views
how to create 2D collision detection
I would like to know the best or most effective way to test for 2D collision.
I also can do AABBs but when you have a line, for example, that is rotated 45ยบ, and it is really long. it will be hitting ...
0
votes
5answers
394 views
Collision detection logic
Edit 2
In the following picture sprite1 (the red square) is hitting the platform from the left, so:
sprite1_rightEdge>platformSprite leftEdge
would be true, so I can simply reposition ...
8
votes
4answers
968 views
Collision rectangle response
I'm having difficulties getting a moveable rectangle to collide with more than one rectangle.
I'm using SFML and it has a handy function called intersects which takes 2 rectangles and returns the ...
7
votes
5answers
1k views
How to determine which cells in a grid intersect with a given triangle?
I'm currently writing a 2D AI simulation, but I'm not completely certain how to check whether the position of an agent is within the field of view of another.
Currently, my world partitioning is ...
7
votes
3answers
643 views
Your recommendation for path construction from a single background image?
So I currently have my background as a single PNG and some obstacles (like blocks as part of that PNG). In order to create a path, I currently store pixels above a unique green color (my hill) and use ...
6
votes
4answers
1k views
How do I find the intersection of two lines
I have a bounding box on my character, its position in the previous frame an the current frame. The bounding box is axis aligned.
My character is running around inside a cave, I have a list of ...
5
votes
2answers
1k views
Collision Detection, player correction
I am having some problems with collision detection, I have 2 types of objects excluding the player. Tiles and what I call MapObjects. The tiles are all 16x16, where the MapObjects can be any size, but ...
5
votes
1answer
1k views
how get collision callback of two specific objects using bullet physics?
I have got problem implementing collision callback into my project. I would like to have detection between two specific objects. I have got normall collision but I want one object to stop or change ...
4
votes
1answer
758 views
Are there any good engines for isometric collision detection and platforming?
I've decided to resurrect an old game idea I had years ago. I currently have zero experience with programming, but I'm going to begin studying either C#, Python or both in the near future.
The issue ...
4
votes
1answer
2k views
Line-Rectangle Collision Detection and Response
I've looked through Google and none of the solutions seem to pinpoint my idea. Ultimately, I want to create a level editor where I can draw lines and have them exported to a file for my engine to ...
3
votes
1answer
147 views
Moving the jBullet collision body to with the player object
I am trying to update the location of the rigid body for a player class, as my player moves around I would like the collision body to also move with the player object (currently represented as a ...
3
votes
3answers
216 views
Physics System ignores collision in some rare cases
I've been developing a simple physics engine for my game. since the game physics is very simple I've decided to increase accuracy a little bit. Instead of formal integration methods like fourier or ...
3
votes
1answer
550 views
Character jittering with this tile based collision code
I have been trying to get my collision code working for hours now but with every resource I have tried my character still jitters. First I tried using the platformer sample but my character still ...
3
votes
1answer
757 views
2D Collision: Check before or check after?
I'm using velocity to move my character, I just add/subtract 0.4f and then update the players position in the update loop.
I was wondering, when would be the best place to check for collision? Do I ...
3
votes
2answers
1k views
Algorithm to fit shapes to 2D grid?
Let's say you have an n-by-m grid. Some squares are occupied, some are not.
You want to know where in the grid you can fit arbitrary shapes such as to not hit an occupied square. The shapes would ...
3
votes
4answers
464 views
How to avoid collision detection to enter infinite loop in this case?
I am writing a collision detection system which uses the logic mentioned by Trevor here
But I have anticipated a problem which I have shown as a diagram
How do we handle this problem?
2
votes
1answer
636 views
Platformer Starter Kit - Collision Issues
I'm having trouble with my game that is based off the XNA Platformer starter kit.
My game uses smaller tiles (16x16) then the original (32x40) which I'm thinking may be having an effect on collision ...
1
vote
1answer
214 views
How to detect screen boundary using AndEngine GLES1?
I am using the AnalogOnScreenControl to move my sprite around the screen. I would like to restrict the sprite so it can not move outside the screen boundaries.
I have tried putting a line at the ...
1
vote
1answer
189 views
How do I detect multiple sprite collisions when there are >10 sprites?
I making a small program to animate the astar algorithm. If you look at the image, there are lots of yellow cars moving around. Those can collide at any moment, could be just one or all of them could ...
1
vote
3answers
518 views
Collision Detection Problems
So I'm making a 2D tile based game but I can't quite get the collisions working properly. I've taken the code from the Platformer Sample and implemented it into my game as seen below.
One problem I'm ...
1
vote
1answer
373 views
How can we match polygon data structure with a background image
I am referring to this fireball game.
The ball will collide with background, which is in polygon form.
I was wondering, how I can match my polygon data structure with the background image. Say, I ...
1
vote
3answers
2k views
How to detect which edges of a rectange touch when they collide in iOS
I'm creating a basic "game" in iOS 4.1. The premise is simple, there is a green rectangle ("disk") that moves/bounces around the screen, and red rectangle ("bump") that is stationary. The user can ...
0
votes
2answers
539 views
Reflect angle on pong clone
I'm working on collision detection for a pong clone. I've calculated the angle of incidence but I can't find any information on how to specular reflect the angle I found.
The code for calculating the ...
0
votes
1answer
311 views
How can I determine which direction a 2D collision is occurring from?
The problem is as follows:
Think 2D Zelda (Links Awakening, A Link to the Past) style movement where you can run into walls from any of the four cardinal directions, or basically up, down, left, and ...
7
votes
3answers
591 views
Polygon editor to draw collision data over image
I need an editor to plot a polygon over the texture for of a ship in my game.
It would look like this..
Where the red is the collision outline and the image is the texture.
I want to store the ...
5
votes
6answers
241 views
How do I calculate distance from a point to a rectangle?
I have a 2D rectangle with x, y position, height and width, and a randomly positioned point nearby.
Is there a way to check if this point might collide with the rectangle if it is closer than a ...
5
votes
2answers
634 views
Swept AABB vs Line Segment 2D
I've really exhausted as much as Google has to give, I've spent a solid week googling every combination of words for an "AABBvsLine sweep", downloaded countless collision demos, dissected SAT ...
5
votes
1answer
2k views
How do I calculate collision response between a sphere and a plane?
I'm trying to create a simple 3D game and need to constrain the player within the limits of the game world. When the player hits the sides of the world I want the player's ship to bounce off slightly.
...
4
votes
2answers
525 views
I need help with 2D collision response (of stacking rotating polygons, with friction and gravity, for a game)
Hi I am looking for suggestions on how to write a collision response for game programming purpose (so not a scientific simulation). I am dealing with 2D polygons that are rotating, and I want them to ...
4
votes
2answers
688 views
Collision response for 2D racing game
The title is fairly self-explanatory. I have a 2D racing game that utilizes per-pixel collision detection (the track is essentially two bitmaps, one for the graphics, one for collision data). The ...
4
votes
1answer
667 views
Closest point on an ellipsoid
I need to know how to get the closest point on the surface of an ellipsoid to another point.
I had an idea, but apparently i was wrong, and oversimplfying.
What i did was squash the ellipsoid and ...
4
votes
1answer
541 views
Ellipsoid v. Box collision detection
I'm trying to write some collision detection code.
ATM i have the code properly resolving Ellipsoid v. Ellipsoid collisions, and Box v. Box collisions, but Ellipsoid v. Box collisions doesnt work.
...
4
votes
3answers
2k views
Why do we use physics engines for collision testing or raycasting?
There is a thing I don't understand about game engines: why it is so common to use physics engines to do raycasting or collision testing?
Say that you have a 3D scene loaded in your scene manager ...
3
votes
2answers
616 views
Circle-Rectangle collision resolution
I have a non axis aligned rectangle, like a car, in my game. I have to check and resolve the collision between the rectangle and circle, which is stationary.
I have found lots of ways to determine ...
