The determination of whether or not two or more entities make contact with each other during gameplay.

learn more… | top users | synonyms (2)

1
vote
1answer
240 views

How can I know in which direction 2 balls will go in billiard game?

When a ball is struck, how can we know in which direction both balls will go when ball is struck? I know the angle at which the ball strikes the other ball matters, but how can we calculate that ...
0
votes
1answer
2k views

Java/Android pixel perfect hit detection

I am making a game for android which I need hit detection between two objects. The first bitmap I have is a flying superhero, and the second bitmap is anything that he collides with. The superhero ...
1
vote
2answers
664 views

Which axis-aligned line does an AABB collide with first?

I am making the collision resolution system for my 2d top-down game, and I managed to find a solution where I query which surfaces of other AABBs the current entity can collide with in the next frame. ...
3
votes
4answers
653 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?
1
vote
1answer
1k views

XNA boundingbox 2d rectangle

I'm checking to see if the ray that I've created is intersecting with a rectangle. I'm using the boundingbox class to pass the rectangle into the intersect method in the Ray class, but unfortunately ...
1
vote
2answers
818 views

Getting 2D Platformer entity collision Response Correct (side-to-side + jumping/landing on heads)

I've been working on a 2D (tile based) 2D platformer for iOS and I've got basic entity collision detection working, but there's just something not right about it and I can't quite figure out how to ...
15
votes
2answers
1k 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 ...
6
votes
2answers
3k views

Stuck in Wall after rectangle bounding box collision

Using XNA's built in Intersects() on two Rectangles, I can detect a collision and set my velocity to zero. However, the object is stuck there and can't get out! How can I resolve this collision ...
2
votes
1answer
958 views

How do I determine the collision normal in an axis aligned bounding box collision?

I have a 3d moving box and a stationary box. I can detect collisions ok but now I would like to slide the moving box against the stationary box as a collision response. For this I need the normal of ...
4
votes
1answer
907 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 ...
1
vote
1answer
3k views

Collision Detection for sidescrolling Tile based Game

I've been working on a tile based game with a 2d array as fundamental ground for my tiles. Now my next step is to have the wall tiles be impenetrable, so that the player can walk ontop of them and ...
4
votes
1answer
729 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. ...
2
votes
1answer
361 views

How to efficiently organise all object in a large space

I've just about started with a project I've had in mind for ages. I don't quite know how to start such big projects (bigger than Pong, anyway), so I thought I would get started by making a basic ...
6
votes
2answers
498 views

Collision Detection/Response in Vector-based levels

I have a 2D side scroller whose levels are stored as vectors (that is, a bunch of lines) which looks like this: How would I detect that I'm colliding with one of these lines, and react accordingly ...
2
votes
3answers
3k views

Unity, changing gravity game & stopping character when he hit a wall

i am currently working on a 2d puzzle game in the unity engine. One of the aspect of this game is the possibility to rotate the level of 90°. It also rotate the gravity. The main character is not ...
2
votes
2answers
288 views

Testing for 2D collision outcome

I'm currently building a small 2D game in Processing (and it has to be Processing) for a school project. The basic makeup of the game is 4 different cells (objects, all are circles): An avatar, ...
5
votes
2answers
1k views

Tile based collision detection failing when player is going too fast

I'm creating a side scroller and I'm have a problem with my collision detection. The collision detection works perfect when the player is falling at a constant speed, but when I implement more ...
5
votes
4answers
277 views

detecting the coordinates where a bullet hits a mesh

I have a lot of complex objects in a scene and I'm looking for an efficient way to find which object a fired bullet hits, and to find the hit coordinates. It would be best if there was a lightweight ...
6
votes
2answers
3k views

Tiled based map collision detection problem

I'm working on a tile-based Mario clone. I have implemented the tile based collision method from the tutorial http://www.tonypa.pri.ee/tbw/tut05.html. This works all fine when walking and falling. ...
14
votes
2answers
1k views

Best/Efficient way to implement a 3d Collision

I've already programmed a 2d based collision system for a previous game. It was my first collision system and it was ugly. I was looking for collision between objects by checking all objects with all ...
2
votes
3answers
1k views

Actionscript 3: Which side of object is hit?

I have a two objects colliding with each other. I am testing for the collision with if(ob1.hitTestObject(ob2)){//do something }. Is there a way to determine which side of the object was hit, i.e. if ...
6
votes
4answers
2k 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 ...
3
votes
2answers
246 views

How to generate slopes that meet the plane, is using collision detection a good idea?

I have a terrain, which is defined by mesh. And there are a lot of other polygonal faces scattered throughout the terrain, they can be located above, or below or cutting through the terrain. You can ...
4
votes
1answer
3k 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 ...
1
vote
2answers
498 views

Problems with Creating Snake's Clone on Java

I'm creating Snake's clone. My app have too classes: Snake.java and Board.java. Right now I have three problems: 1) There are two constants - BOARDS_WIDTH, BOARDS_HEIGHT. They are meant to be ...
2
votes
1answer
282 views

Different collision effects on different objects

I'm a beginner to Corona and game development. I am using a variety of objects in my game. On collision, they all perform the same function. I want them to do different things, and also want some ...
5
votes
3answers
1k views

Make my NPC “see” gameobjects around him in Unity

I have a walking NPC that will "see" the wall in front or behind him (2d gameplay) and that will react accordingly. I was thinking to attach him to an invisible collider that would react to objects ...
1
vote
2answers
595 views

Ball bouncing within polygon

I saw there are quite a number of articles and sample code regarding ball bouncing within a rectangle. Is there any articles or sample code regarding ball bouncing within a polygon? I try to look ...
2
votes
3answers
2k views

2d Collision detecton axis aligned boxes

I have recently run into some trouble with my collision detection. My game is composed of a map made out of axis aligned squares. The player has an x and y velocity, and I want to know how I can find ...
1
vote
4answers
2k views

Have a simple enemy detecting he touch a wall to make him stop/turn around

I am doing a very simple scene with a cube sliding on the "ground". Once the cube reach a wall, he is blocked. I want to detect the wall to make the cube go in the other direction. I used ...
1
vote
1answer
145 views

Degrees to Coordinates

Hey, I'm creating my second game ever, but this time - using Java. Before I used Pascal and CRT module! =D It's 2D game where you need to drag the ball with mouse from location A to location B. Right ...
-1
votes
1answer
159 views

Operations on multiple overlapping layers not working

Hi I am developing a game in android just like Farmville by Zinga. In that game we have to place elements in the diamond shaped field so the don't overlap each other. Now I did coding for placing the ...
9
votes
1answer
2k views

How to create a realistic 2D Role-Playing game collision detection?

I’ve always wanted to create an old-fashionned 2D Role-Playing Game like Star Ocean, Final Fantasy, Sword of Mana and even the “Tales of” series, and I guess a lot of people do. But before even ...
2
votes
1answer
783 views

Help with Collision of spawned object(postion fixed) with objects that there are translating on screen

Hey guys I am creating a game using Corona SDK and so coding it in Lua. So there are 2 separate functions, To translate the hit objects and change their color when they are tapped The link below ...
7
votes
1answer
2k views

Given a plane and a point, how can I determine which side of the plane the point is on?

Given the point Vector pos = new Vector(0.0, 0.20156815648078918, -78.30000305175781, 1.0); and the plane (triangle) Vector a = new Vector(-6.599999904632568, 0.0, -78.5, 1.0); Vector b = new ...
2
votes
3answers
970 views

Flash AS3 Tower Defense Problem

I am working on a tower defense game in Flash. Right now most towers find the the nearest enemy in range (enemies are in an array), get the enemies coordinates, and fire a bullet. When it hits the ...
12
votes
5answers
3k views

2D Rope Collision Detection

I'm wanting to create a rope that can collide with objects like in the following youtube video: 2D Game Physics Rope I'm thinking that you implement the verlet integration which uses points and ...
7
votes
1answer
541 views

Finding the point of collision

I'm writing a 2D rigid body simulator. The objects being simulated are convex polygons. My question involves how to decide on the "point" of collision, so that when I apply a response force, I can ...
2
votes
3answers
2k views

2d Ray intersection

I've recently picked up a class which creates 2D Rays and detects if the ray is intersecting any bounding boxes passed through it. public struct Ray2D { private Vector2 startPos; ...
1
vote
2answers
650 views

Collision Problems

I'm having some troubles with a 2D platformer type game (there's more to it, but that's all that matters for this question). I had collision with the platforms working fine, but if the character hit ...
32
votes
3answers
3k views

A ball hits the corner, where will it deflect?

I need to brush up my trigonometry and hope you can help here with a simple mathematical model. Here is my model so far in the image attached. I am aware that the frame animation has other problems ...
3
votes
3answers
347 views

Collision test solution for hack&slash game

I want to ask you what is the best way to deal with collisions in hack&slash game, I know that collisions must be very accurate. My first idea is to use sphere bounds ( I making hack&slash in ...
7
votes
1answer
562 views

XNA 2D Collision Detection without GetData()

I'm currently working on a Worms game which involves terrain deformation. I used to do it with .GetData(), modifying the color array, then using .SetData(), but I looked into changing it to make the ...
5
votes
2answers
1k views

Determining if a character is within the field of view in XNA

I'm trying to creating a field of view for the camera I'm making for a game. It rotates around a circle for 180 degrees while the head moves accordingly. I'm going to bound the field of view within an ...
4
votes
1answer
1k views

Are Loose Octrees Too Loose?

I've been reading Real-Time Collision Detection and for loose octrees it recommends expanding each node's AABB length by a factor of 2, making its expanded volume 8 times as large. I am surprised ...
5
votes
2answers
1k 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 ...
5
votes
3answers
1k views

Android collision detection of a 3d object based on a 2d projection

I am writing a game for android. We have an orthographic view setup, but the characters (ships, projectiles, etc). The enemies / characters will be able to rotate about the x axis. The problem is that ...
13
votes
1answer
2k views

Quad trees/grid based collision - putting logic into action

First of all, I've only been writing my own game logic for a short while, so I apologize if this might seem straight forward. I've been reading a lot about quad trees and grid based collision ...
2
votes
4answers
3k views

per pixel based collision detection

I was wondering if anyone had any ideas on how to get per pixel collision detection for the android. I saw that the andEngine has great collision detection on rotation as well but couldn't see where ...
8
votes
4answers
822 views

Moving objects colliding when using unalligned collision avoidance (steering)

I'm having trouble with unaligned collision avoidance for what I think is a rare case. I have set two objects to move towards each other but with a slight offset, so one of the objects is moving ...