almoos dere
This commit is contained in:
@@ -84,7 +84,7 @@ Vector3f Player::GetInput(bool front, bool back, bool left, bool right, bool jum
|
||||
return delta;
|
||||
}
|
||||
|
||||
Player::Sound Player::ApplyPhysics(Vector3f input, World* world, float elapsedTime, Booster booster_table[]) {
|
||||
Player::Sound Player::ApplyPhysics(Vector3f input, World* world, float elapsedTime, std::unordered_map<uint64_t, Booster*> booster_table) {
|
||||
Player::Sound snd = Player::Sound::NOSOUND;
|
||||
static float timing = 0.f;
|
||||
/* Gestion de collisions */
|
||||
@@ -196,16 +196,16 @@ void Player::ApplyTransformation(Transformation& transformation, bool rel, bool
|
||||
if (rel) transformation.ApplyTranslation(-GetPOV());
|
||||
}
|
||||
|
||||
void Player::TakeBooster(Booster booster_table[], float elapsedtime)
|
||||
void Player::TakeBooster(std::unordered_map<uint64_t, Booster*> booster_table, float elapsedtime)
|
||||
{
|
||||
Vector3f playerpos = GetPosition();
|
||||
for (int i = 0; i < sizeof(booster_table); i++)
|
||||
for (auto& [key, booster]: booster_table)
|
||||
{
|
||||
Vector3f pos = booster_table[i].GetPosition();
|
||||
if (abs(playerpos.x - pos.x) <= 0.5f && abs(playerpos.y - pos.y) <= 1.0f && abs(playerpos.z - pos.z) <= 0.5f && booster_table[i].GetAvailability() == true)
|
||||
Vector3f pos = booster->GetPosition();
|
||||
if (booster->GetAvailability() && abs(playerpos.x - pos.x) <= 0.5f && abs(playerpos.y - pos.y) <= 1.0f && abs(playerpos.z - pos.z) <= 0.5f)
|
||||
{
|
||||
GetBooster(booster_table[i].GetType(), elapsedtime);
|
||||
booster_table[i].SetAvailability(false);
|
||||
GetBooster(booster->GetType(), elapsedtime);
|
||||
booster->SetAvailability(false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user