libs/PlayerCar.cpp
/**
	 * @brief Construct a new Player Car:: Player Car object
	 *
	 * @param _data Pointer Reference to the resources and state machines.
	 * @param car_num The sprite number for the car object
	 */
@brief Construct a new Player Car:: Player Car object
@param _data Pointer Reference to the resources and state machines.
@param car_num The sprite number for the car object
@brief Construct a new Player Car :: Player Car object @param _data Pointer Reference to the resources and state machines . @param car_num The sprite number for the car object
PlayerCar::PlayerCar(GameDataRef _data, int car_num)
		:Car(_data,car_num){
		e_speed = sf::Vector3f(0, 0, rand()%20);
		sprite.setTexture(data->assets.get_texture("CarImage" + std::to_string(car_image_num)));
		e_position.x = -2+rand()%4;
		e_position.z = 10000+rand()%10000;
		if (car_image_num == 8)
		{
			health = 50;
			e_max_speed.z = 250;
		}
		car_mass=100;
		in_use=true;
	}
PlayerCar :: PlayerCar ( GameDataRef _data , int car_num ) : Car ( _data , car_num ) { e_speed = sf :: Vector3f ( 0 , 0 , rand ( ) % 20 ) ; sprite . setTexture ( data -> assets . get_texture ( " " + std :: to_string ( car_image_num ) ) ) ; e_position . x = -2 + rand ( ) % 4 ; e_position . z = 10000 + rand ( ) % 10000 ; if ( car_image_num == 8 ) { health = 50 ; e_max_speed . z = 250 ; } car_mass = 100 ; in_use = true ; }
@brief Construct a new Player Car:: Player Car object
 @param _data Pointer Reference to the resources and state machines.
@brief Construct a new Player Car :: Player Car object @param _data Pointer Reference to the resources and state machines .
/////// Setting up entity //////// /////////////////////////////////// // else health = 100000;