I'm programming a game and would like to know what the best way is to program a collision detection for an object. I heared that it's the hardest part of game programming. Any tip would be appreciated.
1 Answers
It is hard to give a specific answer to your question with no information about how you are making the game.
If it is a 2D game then rectangular collision detection is easy to implement. If you are using something like XNA (for Windows) or Andengine (for Android) then all the methods are already done for you and the learning resources for both - XNA in particular - are great.
If it's a learning project and you really want to do it from scratch then look at any of the really good resources on line, such as this 2D collision tutorial which helped me with my college project - which was a game.
If it's a 3D game and you're not a big fan of maths then consider an open source game engine or something like XNA to begin with.
If you want to give more detail - programming language, platform etc then you might get some more useful answers.

- 1,209
- 5
- 18
- 33
-
Well, I'm programming the game in 2d and have very small experience in game programming. The objects what I'm using as an example are 2 circles. Sorry about the small detailed question from before, I was in a hurry to school... 2nd question: Which engine is better: AndEngine or OpenGL for the Android? – Aerial Oct 24 '11 at 11:36
-
AndEngine is an OpenGL game engine for Android. OpenGL is a graphics programming technology used in Android and most other platforms (XNA uses DirectX instead). It is not a game engine itself. Look up Andengine or [BadLogic](http://code.google.com/p/libgdx/). If you have spare money this is a really good book on Android game dev [BadLogic Book](http://www.amazon.com/Beginning-Android-Games-Mario-Zechner/dp/1430230428/ref=sr_1_2?s=books&ie=UTF8&qid=1319458499&sr=1-2). This may help [Related Question](http://stackoverflow.com/questions/335600/collision-detection-between-two-images-in-java). – Ruairi O'Brien Oct 24 '11 at 12:19