Jump to content
Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.
Posted 21 November 2012 - 06:08 AM
Posted 21 November 2012 - 11:11 AM
Posted 21 November 2012 - 12:00 PM
(PlayerDir.x * EnemyDir.x + PlayerDir.y * EnemyDir.y);
Edited by DgekGD, 21 November 2012 - 12:04 PM.
Posted 22 November 2012 - 12:36 AM
Posted 22 November 2012 - 11:55 AM
Edited by Stroppy Katamari, 13 December 2012 - 04:02 PM.
Posted 28 November 2012 - 11:12 AM
Posted 13 December 2012 - 11:27 AM
Posted 13 December 2012 - 12:21 PM
Posted 13 December 2012 - 01:42 PM
But what would happen if this test is performed when they are intersecting already?
Posted 13 December 2012 - 03:20 PM
Posted 13 December 2012 - 04:00 PM
If you just have the locations of two overlapping rectangles, there is no way to tell accurately whether they collided vertically or horizontally. You have to know where they came from, in other words, where they were at last frame. Current position minus velocity gives you that last position, so you don't have to store the last position separately.
Well my so called "solution" was limited to work with one single situation and the code is not reusable.
I want a global method to check this, so I have looked a bit closer at Stroppy Katamaris post.
With all due respect, your text is cryptic. Why is velocity needed? Old R2? timex/timey?
Could you please clarify your post?
GameDev.net™, the GameDev.net logo, and GDNet™ are trademarks of GameDev.net, LLC.