Donkey Kong (DAE's 2D Game Engine)

This Donkey Kong game was the first game I made as a DAE student. The goal of the is just like the original game Donkey Kong Country were the player has to get to the end, collect bananas and hit the enemies by either jumping on them or by throwing barrels. Diddy Kong helps you when you open a DK barrel, but also Rambi the Rhinoceros when you open his crate. The game was created in the DAE engine. The physics in the game are from the Box2D library.

Here you can see some snippets from the Barrel Class that was used

void Barrels::BeginContact(PhysicsActor *actThisPtr, PhysicsActor *actOtherPtr)
{
	if (actOtherPtr->GetUserData()==2 && actThisPtr->GetUserData()==7)
	{
		m_Destroyed = true;
		if (m_BarrelType==BarrelType::KONGBARREL)
		{
			m_OpenedDKBarrel = true;
		}
	}
	if (actOtherPtr->GetUserData()==1 && actThisPtr->GetUserData()==14)
	{
		m_Destroyed = true;
	}
}

void Barrels::PreSolve(PhysicsActor* actThisPtr, PhysicsActor* actOtherPtr, bool & enableContactRef)
{
	if (actOtherPtr->GetUserData()==1 || actOtherPtr->GetUserData() == 13 || actOtherPtr->GetUserData() == 8)
	{
		enableContactRef = false;
	}
}