project2D/turret.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 .
turret::turret(char* textureUrl) : Entity(textureUrl)
{
	antenna = new Antenna("rock_large");
	antenna->setParent(this);
	this->setChild(antenna);
	rotSpeed = 3.14f;
	for (int i = 0; i < 15; i++)
	{
		Vector2 temp;
		bullets[i] = new Bullet(nullptr, temp, 5.0f);
	}
	bulletCount = 0;
}
turret :: turret ( char * textureUrl ) : Entity ( textureUrl ) { antenna = new Antenna ( " " ) ; antenna -> setParent ( this ) ; this -> setChild ( antenna ) ; rotSpeed = 3.14f ; for ( int i = 0 ; i < 15 ; i ++ ) { Vector2 temp ; bullets [ i ] = new Bullet ( nullptr , temp , 5.0f ) ; } bulletCount = 0 ; }
Default Constructor.
Default Constructor .
// Create an Antenna. // Set its parent to Turret. // Set turrets child to Antenna. // initialize rotSpeed. // Create 15 bullets. // initialize bulletCount.