project2D/Entity.cpp
//--------------------------------------------------------------------------------------
// Default Constructor.
//
// Param: 
//		textureUrl: Takes in a char for specifying a texture url in texture file location.
//--------------------------------------------------------------------------------------
Default Constructor.
Param:
textureUrl: Takes in a char for specifying a texture url in texture file location.
Default Constructor . Param : textureUrl : Takes in a char for specifying a texture url in texture file location .
Entity::Entity(char* textureUrl)
{
	Parent = nullptr;
	m_Collider.m_TL = Vector2(-30, -30);
	m_Collider.m_BR = Vector2(30, 30);
	boundingBox.SetSize(Vector3(-60, -60, 0));
	if (textureUrl != nullptr)
	{
		char tempChar[32];
		strcpy(tempChar, "./textures/");
		strcat(tempChar, textureUrl);
		strcat(tempChar, ".png");
		texture = new Texture(tempChar);
	}
	else
	{
		texture = nullptr;
	}
}
Entity :: Entity ( char * textureUrl ) { Parent = nullptr ; m_Collider . m_TL = Vector2 ( -30 , -30 ) ; m_Collider . m_BR = Vector2 ( 30 , 30 ) ; boundingBox . SetSize ( Vector3 ( -60 , -60 , 0 ) ) ; if ( textureUrl != nullptr ) { char tempChar [ 32 ] ; strcpy ( tempChar , " " ) ; strcat ( tempChar , textureUrl ) ; strcat ( tempChar , " " ) ; texture = new Texture ( tempChar ) ; } else { texture = nullptr ; } }
Default Constructor.
Default Constructor .
// initialize Parent to null // Bind the boundingbox with Entity. (for AABB collision.) // Set the size of the boundingbox // if a textureUrl isnt given set it to null  // Create the url for the texture of the entity.