gameEngine/gameEngine/Colliders/CircleCollider.cpp
//consturctor with a position offset from it's sprite
consturctor with a position offset from it's sprite
consturctor with a position offset from it ' s sprite
CircleCollider::CircleCollider(std::string name, AbstractSprite &parent, float r, float posX, float posY) :
	spriteParent(&parent), radius(r)
{
	this->Center.x = posX;
	this->Center.y = posY;
	this->Position.x = this->Center.x - this->Size.x / 2;
	this->Position.y = this->Center.y - this->Size.y / 2;
	this->Size.x = r*2;
	this->Size.y = r*2;
	this->type = "circle";
	this->active = true;
	this->transparency = float(.15);
	if (ResourceManager::Textures["textures/green.png"].Image_Format == 6407)
	{
		ResourceManager::LoadTexture("textures/green.png", true, "debugGreen");
		ResourceManager::LoadTexture("textures/greenCircle.png", true, "debugGreenCircle");
	}
}
CircleCollider :: CircleCollider ( std :: string name , AbstractSprite & parent , float r , float posX , float posY ) : spriteParent ( & parent ) , radius ( r ) { this -> Center . x = posX ; this -> Center . y = posY ; this -> Position . x = this -> Center . x - this -> Size . x / 2 ; this -> Position . y = this -> Center . y - this -> Size . y / 2 ; this -> Size . x = r * 2 ; this -> Size . y = r * 2 ; this -> type = " " ; this -> active = true ; this -> transparency = float ( .15 ) ; if ( ResourceManager :: Textures [ " " ] . Image_Format == 6407 ) { ResourceManager :: LoadTexture ( " " , true , " " ) ; ResourceManager :: LoadTexture ( " " , true , " " ) ; } }
consturctor with a position offset from it's sprite
consturctor with a position offset from it ' s sprite
//make sure collider textures are not already loaded //texture for collider debug