answersLogoWhite

0


Best Answer

The simplest solution is to imagine a bounding circle around the player. If the player's centre is less than the radius of that circle from the wall's edge, then a collision has occurred. More complex solutions will use several circles centred upon various parts of the player, and test each one individually. You can also use other geometric shapes such as squares and rectangles, or a combination of shapes, whichever best suit the overall shape of the player, and the objects which they may collide with. The trick is to simplify the object's overall shape in order to reduce the amount of processing required to detect a collision. Games like Angry Birds obviously use a lot of collision detection, but all the birds are more or less circular in shape, thus reducing the processing required. The collisions are rarely exact, however, but they are obfuscated by explosions, debris, feathers, and so on, thus giving the impression an impact has occurred.

User Avatar

Wiki User

10y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Can anyone give a code in c plus plus for a collision between player and wall?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is hash collision?

Hash collision means....2 different keywords having the same hash code. Yes its as simple as that........


Does anyone have an unused code for littlestpetshop?

cupcake why would anyone give you a code


Does anyone have the 39 clues card codes?

P3X32922XP its my player card code, i am a tomas. also mine is P4N7N4KRXP i am a ekatrina


Does anyone have 39 clues card codes?

P3X32922XP its my player card code, i am a tomas. also mine is P4N7N4KRXP i am a ekatrina


Does anyone have and code for Meez.com?

there is no code for meez!


Anyone know the master code for the CD player for a 99 4dr civic ex Riding with no music sucks?

Each radio has it's own code so you would have to go to the dealership to get that code. Sorry


What is the code on game maker 8 to set score to 0 if hit by something?

score = 0; Put the code in a collision event.


Does anyone have a useful code for buildebarvillecom?

if anyone does its mew2mewtwo! 111324364636128


Has anyone got a meez code?

The meez code is WelcomeBack09 This is the code for June16!!!


Does anyone have a code for Build-A-Bearville?

You can get a code from BABW for $10.


Does anyone have another unused club penguin certificate code?

anyone?


Does anyone have a code for rose?

56TruBlo5