libs/GameSimulator.cpp
/**
	 * @brief This method provide room for updating all the entities
	 *
	 * @param delta This is the time difference between two frames.
	 */
@brief This method provide room for updating all the entities
@param delta This is the time difference between two frames.
@brief This method provide room for updating all the entities @param delta This is the time difference between two frames .
void GameSimulator::update(float delta) {
		focus_on(main_player_id);
		map.bound_entity(main_camera);
		for(auto &player_i:players_map) {
			map.bound_entity(player_i.second);
		}
		for (auto itr : bullet_set[current])
			map.bound_entity(*itr);
		for (auto itr : bullet_set[current])
			itr->update_car(delta, map.lines, map.getSegL());
		std::vector<Car*> entities = get_entity_list();
		Collision::simulate_physics(entities, map);
		bar.percentage = players_map.at(main_player_id).health;
		if(players_map.at(main_player_id).health==0){
			resource_store->machine.add_state(StateRef(new BustedState(resource_store)), true);
		}
		text[1].setString(std::to_string((int)score));
	}
void GameSimulator :: update ( float delta ) { focus_on ( main_player_id ) ; map . bound_entity ( main_camera ) ; for ( auto & player_i : players_map ) { map . bound_entity ( player_i . second ) ; } for ( auto itr : bullet_set [ current ] ) map . bound_entity ( * itr ) ; for ( auto itr : bullet_set [ current ] ) itr -> update_car ( delta , map . lines , map . getSegL ( ) ) ; std :: vector < Car * > entities = get_entity_list ( ) ; Collision :: simulate_physics ( entities , map ) ; bar . percentage = players_map . at ( main_player_id ) . health ; if ( players_map . at ( main_player_id ) . health == 0 ) { resource_store -> machine . add_state ( StateRef ( new BustedState ( resource_store ) ) , true ) ; } text [ 1 ] . setString ( std :: to_string ( ( int ) score ) ) ; }
@brief This method provide room for updating all the entities
 @param delta This is the time difference between two frames.
@brief This method provide room for updating all the entities @param delta This is the time difference between two frames .
// Collision working // std::cout << "CAR health" << players_map.at(main_player_id).health << std::endl;