Questions tagged [collision-detection]

Collision detection is the determination of whether or not two or more entities make contact with each other during gameplay.

Filter by
Sorted by
Tagged with
5
votes
2answers
753 views

3D Particle-Geometry collision

I am programming a particle engine for a 3D game written in XNA. I was wondering if somebody could point me in the right direction or perhaps give me some pointers in making the particles collide with ...
1
vote
1answer
780 views

2D collision and getting closer to objects

Just curious what to do from here. So I am done with my tile editor program and currently have it set up so that my background (which is one large image) is mapped in XML to 32x32 tiles (again, a ...
9
votes
3answers
594 views

How to detect collisions between sprite and a user generated shape of some sort?

How to detect a collision between a sprite and a user-generated shape of some sort. For example. There are some objects on the screen. The user takes their finger and draws a circle shape around an ...
5
votes
2answers
852 views

Tiles and a walkable path

My game a sidescrolling platformer. I've created my own Tile app which in the end export an xml file detailing what each 32x32 space (in the entire image) contains (environment, platform, etc.). I get ...
7
votes
1answer
616 views

How to represent a game character in code?

In a previous game I wrote I had a game character class. This class tracked the location, velocity, and a set of states. Except the states were tied very close to the animation. Each state would have ...
11
votes
3answers
3k views

FPS Collision detection and movement

How is collision detection and movement typically handled in a FPS, particularly handling slight changes in ground height such as stairs (both on incline and decline)?
7
votes
3answers
842 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 ...
24
votes
4answers
12k views

Should collision detection be done server-side or cooperatively between client/server?

I am working on an online game that will have very heavy collision detection processing. Player models will collide with other players, mobs, structures, terrain, and solid objects that only exist ...
5
votes
2answers
454 views

What are the technologies that makes physics engines so good for raycasting?

again. This question is strictly related to this one so, what is the technology that makes physics engines suitable for raycasting? It is a particular data structure? Has it to do with the engine's ...
4
votes
3answers
4k 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 (...
6
votes
3answers
3k views

Implementing a 2D Platformer Game Engine

Any ideas where I can find info about making 2D jump & run games? I need some general ideas, so I wouldn't reinvent wheel (at least where game design is concerned). Another point is that I am ...
5
votes
1answer
1k views

2D collision-detection middleware [closed]

(This question was split off from 3D collision-detection middleware) Are there any recommendable middleware available for 2D collision detection? I believe I've heard that Box2D could be used for ...
4
votes
1answer
2k views

New Vector Calculation for Elastic Collision of Circle and Fixed Rectangle

I am writing a fairly simple breakout-style game for Android phones. I have successfully detected the collisions between the ball(s) and bricks. The problem that I am having is in calculating the new ...
7
votes
3answers
1k views

3D collision-detection middleware [closed]

(I've split this question into two. For 2D, see: 2D collision-detection middleware) Are there any recommendable middleware available for 3D collision detection? I believe I've heard Bullet has a ...
12
votes
5answers
4k views

2D Level design/editing/saving questions [closed]

I thought about making a simple 2D Sidescroller game like SuperMario. Then i wondered about how to save, load or create the levels for the game. The first thing i thought of was drawing a simple ...
10
votes
4answers
1k views

What's the most efficient way to find the intersection point of a missile and a bitmap terrain?

Following up on my earlier question about finding the slope of a 2D bitmap terrain I now need to know the best way of finding the point on the 2D terrain that the missile hit. Obviously, I can see if ...
6
votes
4answers
3k views

How do I calculate the angle of the slope at a point on a 2D bitmap terrain?

I have an arbitrary destructible bitmap terrain like the one in "Worms". It's easy to work out if a character or missile intersects the terrain, but how do I work out the angle of the slope at the ...
-5
votes
2answers
475 views

Why is my hitTest() not working every time? [closed]

I have a code segment in which I use hitTest() a couple of times but at a particular section the hitTest stops working. It doesn'...
2
votes
2answers
2k views

XNA 2D Collision Detection with Rectangles: Helper Objects?

Per this excellent question, and excellent answers, I am attempting to write a breakout clone. Regarding the collision detection against the walls, does XNA provide a set of helper methods/objects to ...
4
votes
4answers
1k views

Authoring Hitboxes

What sort of tools/processes are used for setting up hitboxes and make them move/resize/appear/disappear to match the character animations? I'm working in 2d, so attaching collision volumes to the ...
9
votes
3answers
346 views

Connecting physics simulations with different coordinate-systems

I want objects to move between two physics simulations through a "window" and collide with those from both simulations in case they intersect the window plane. The coordinate systems of the ...
24
votes
9answers
3k views

Is there a simple way to stop enemies standing in the same spot?

So: top-down game, my enemies chase the player, when they get within a certain distance they stand still and fire. If they're all coming from the same direction they all end up standing in the same ...
-5
votes
2answers
353 views

doubts in circle circle collisions [duplicate]

Possible Duplicate: two balls stick together in a pool game? I have problems in circle circle collisions in a pool ball game.. The game has problems like the circles (or balls) stick together: ...
-5
votes
2answers
514 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.
1
vote
2answers
404 views

How to allow character to keep moving after it hits a wall

I am developing an iPhone game. There is a fountain that the user should not be able to walk through. Now, this question is about checking circle-point collision or anything like that. I am checking ...
14
votes
6answers
8k views

How do I handle Isometric collision detection?

I would like to make an isometric run-jump style platformer. The player should be able to jump on top of platforms above the floor, hit the side of objects etc. I'll be using a 2D game engine so I ...
3
votes
1answer
647 views

Collision and response between sprites?

What is an easy way to have sprites collide and react to the collision? E.g. if I'm writing a game in XNA or with Canvas 2D and need to write the code myself very simply.
63
votes
11answers
96k views

What is the fastest way to work out 2D bounding box intersection?

Assume that each Box object has the properties x, y, width, height and have their origin at their center, and that neither the objects nor the bounding boxes rotate.
9
votes
3answers
8k views

Patterns for racing AI behaviour

So let's say you've got a spline-based racing AI. Assume it can already handle the basics of braking and steering around the track. How would you structure and implement collision avoidance, ...
27
votes
7answers
9k views

What is a good algorithm to detect collision between moving spheres?

If (for the purpose of collision detection) 3D objects are represented in a game by spheres, what is a good algorithm to detect a collision between spheres? If each object has a position as of the ...
10
votes
4answers
4k views

In Cocos2D, how do I check for collisions against an arbitrary user-drawn shape?

I want to detect a collision between a sprite and a user-generated shape of some sort. For example. There are 3 objects on the screen. The user takes their finger and draws an abnormal shape around 2 ...