libs/GameSimulator.cpp
/**
	 * @brief Initializing all the entities in the Game
	 *
	 */
@brief Initializing all the entities in the Game
@brief Initializing all the entities in the Game
void GameSimulator::init() {
		fout<<"Executing init"<<std::endl;
		fout << "Assigning id to each bot" << std::endl;
		init_car_res();
		resource_store->assets.load_texture("Bullet", "../res/bullet.png");
		fout << "Car Assests Loaded" <<std::endl;
		for (int i = 0; i < TOTAL_BOTS; i++) {
			add_bot_players();
		}
		bot_inp_reg();
		map.init();
		resource_store->assets.load_texture("GameOverState background", GAME_OVER_BACKGROUND_FILEPATH);
		font = resource_store->assets.get_font("sfafont");
		for (int i = 0; i < 5; i++)
		{
			text[i].setFont(font);
			text[i].setCharacterSize(36);
			text[i].setStyle(sf::Text::Bold);
			text[i].setOutlineColor(sf::Color::White);
			text[i].setOutlineThickness(2);
			text[i].setFillColor(sf::Color::Red);
		}
		text[0].setString("Score:");
		text[0].setPosition(SCREEN_WIDTH / 100, SCREEN_HEIGHT / 100);
		text[1].setPosition(SCREEN_WIDTH / 100, SCREEN_HEIGHT / 100 + 30);
		text[2].setString("Health:");
		text[2].setPosition(SCREEN_WIDTH / 2 - 150, SCREEN_HEIGHT / 100);
		bar.init(sf::Vector2f(300, 20), sf::Vector2f(SCREEN_WIDTH / 2 - 150, 70), sf::Color::White, sf::Color::Black);
		fout << "Map initialized" <<std::endl;
		fout<<"Car and Bots initialized"<<std::endl;
		fout<<"Returning from init"<<std::endl;
	}
void GameSimulator :: init ( ) { fout << " " << std :: endl ; fout << " " << std :: endl ; init_car_res ( ) ; resource_store -> assets . load_texture ( " " , " " ) ; fout << " " << std :: endl ; for ( int i = 0 ; i < TOTAL_BOTS ; i ++ ) { add_bot_players ( ) ; } bot_inp_reg ( ) ; map . init ( ) ; resource_store -> assets . load_texture ( " " , GAME_OVER_BACKGROUND_FILEPATH ) ; font = resource_store -> assets . get_font ( " " ) ; for ( int i = 0 ; i < 5 ; i ++ ) { text [ i ] . setFont ( font ) ; text [ i ] . setCharacterSize ( 36 ) ; text [ i ] . setStyle ( sf :: Text :: Bold ) ; text [ i ] . setOutlineColor ( sf :: Color :: White ) ; text [ i ] . setOutlineThickness ( 2 ) ; text [ i ] . setFillColor ( sf :: Color :: Red ) ; } text [ 0 ] . setString ( " " ) ; text [ 0 ] . setPosition ( SCREEN_WIDTH / 100 , SCREEN_HEIGHT / 100 ) ; text [ 1 ] . setPosition ( SCREEN_WIDTH / 100 , SCREEN_HEIGHT / 100 + 30 ) ; text [ 2 ] . setString ( " " ) ; text [ 2 ] . setPosition ( SCREEN_WIDTH / 2 - 150 , SCREEN_HEIGHT / 100 ) ; bar . init ( sf :: Vector2f ( 300 , 20 ) , sf :: Vector2f ( SCREEN_WIDTH / 2 - 150 , 70 ) , sf :: Color :: White , sf :: Color :: Black ) ; fout << " " << std :: endl ; fout << " " << std :: endl ; fout << " " << std :: endl ; }
@brief Initializing all the entities in the Game
@brief Initializing all the entities in the Game
// players_map.at(main_player_id).e_position.x = 0; // players_map.at(main_player_id).e_position.z = 10000; ///////////////////////////////////////////////