Quantcast
Channel: GameDev.net
Viewing all articles
Browse latest Browse all 17625

Implementing a 2d top down door using hinges

$
0
0

So I've been trying to implement a 2d top down door that I want to behave like the doors in the game Darkwood but I'm having trouble getting it to feel even remotely right. So there's a few things to note: the player is an AABB and the door is an OBB, I'm using SAT to detect collisions from them and get the minimum translation vector (mtv) and then I use a simple check to get the collisions points, and after that I translate the player: 

		CollisionData collided = CheckIfDoorAgentCollided(&door, player);

		std::vector<vec2<float>> collisionPoints;
		if …

Viewing all articles
Browse latest Browse all 17625

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>