Merge branch 'SQC-15_online' of https://github.com/CegepSTH/SQCSim2023 into SQC-15_online

This commit is contained in:
MarcEricMartel 2023-12-13 14:06:29 -05:00
commit 2dbaf84844

View File

@ -118,15 +118,16 @@ void RemotePlayer::Render(TextureAtlas& atlas, Shader& shader, Transformation tr
int index = 0;
angle = -angle;
Vector3f side = angleRemote.Cross(angleCam);
side = -side;
static float time = 0.f;
static bool Shooting = false;
bool isLeft = side.y > 0;
time += elapsedTime;
if (time >= 100)
if (time >= 500)
{
time -= 100;
time -= 500;
if (!current.states.shooting)
Shooting = false;
else
@ -143,7 +144,6 @@ void RemotePlayer::Render(TextureAtlas& atlas, Shader& shader, Transformation tr
else
index = 9;
std::cout << "face" << std::endl;
}
else if (current.states.jumpshot) {
if (Shooting)
@ -156,6 +156,8 @@ void RemotePlayer::Render(TextureAtlas& atlas, Shader& shader, Transformation tr
else if (!current.states.jumping && !current.states.shooting && !current.states.jumpshot)
index = 0;
}
else if (angle >= 0.25 && isLeft) //Frontleft
{
@ -165,7 +167,6 @@ void RemotePlayer::Render(TextureAtlas& atlas, Shader& shader, Transformation tr
else
index = 10;
std::cout << "Frontleft" << std::endl;
}
else if (current.states.jumpshot) {
if (Shooting)
@ -177,6 +178,7 @@ void RemotePlayer::Render(TextureAtlas& atlas, Shader& shader, Transformation tr
index = 26;
else if (!current.states.jumping && !current.states.shooting && !current.states.jumpshot)
index = 1;
}
else if (angle >= -0.25 && isLeft) //ProfileLeft
@ -187,8 +189,6 @@ void RemotePlayer::Render(TextureAtlas& atlas, Shader& shader, Transformation tr
else
index = 12;
std::cout << "ProfileLeft" << std::endl;
}
else if (current.states.jumpshot ) {
if (Shooting)
@ -200,6 +200,7 @@ void RemotePlayer::Render(TextureAtlas& atlas, Shader& shader, Transformation tr
index = 28;
else if (!current.states.jumping && !current.states.shooting && !current.states.jumpshot)
index = 3;
}
else if (angle >= -0.75 && isLeft) //BackLeft
@ -210,7 +211,6 @@ void RemotePlayer::Render(TextureAtlas& atlas, Shader& shader, Transformation tr
else
index = 14;
std::cout << "BackLeft" << std::endl;
}
else if (current.states.jumpshot) {
if (Shooting)
@ -222,6 +222,8 @@ void RemotePlayer::Render(TextureAtlas& atlas, Shader& shader, Transformation tr
index = 30;
else if (!current.states.jumping && !current.states.shooting && !current.states.jumpshot)
index = 5;
}
else if (angle < -0.75) //Dos - side négatif
{
@ -231,7 +233,6 @@ void RemotePlayer::Render(TextureAtlas& atlas, Shader& shader, Transformation tr
else
index = 16;
std::cout << "Dos" << std::endl;
}
else if (current.states.jumpshot) {
if (Shooting)
@ -243,6 +244,7 @@ void RemotePlayer::Render(TextureAtlas& atlas, Shader& shader, Transformation tr
index = 32;
else if (!current.states.jumping && !current.states.shooting && !current.states.jumpshot)
index = 7;
}
else if (angle >= 0.25 && !isLeft) //FrontRight
@ -252,8 +254,6 @@ void RemotePlayer::Render(TextureAtlas& atlas, Shader& shader, Transformation tr
index = 19;
else
index = 11;
std::cout << "FrontRight" << std::endl;
}
else if (current.states.jumpshot) {
if (Shooting)
@ -266,6 +266,7 @@ void RemotePlayer::Render(TextureAtlas& atlas, Shader& shader, Transformation tr
else if (!current.states.jumping && !current.states.shooting && !current.states.jumpshot)
index = 2;
}
else if (angle >= -0.25 && !isLeft) //ProfileRight
{
@ -274,8 +275,6 @@ void RemotePlayer::Render(TextureAtlas& atlas, Shader& shader, Transformation tr
index = 21;
else
index = 13;
std::cout << "ProfileRight" << std::endl;
}
else if (current.states.jumpshot) {
if (Shooting)
@ -288,6 +287,7 @@ void RemotePlayer::Render(TextureAtlas& atlas, Shader& shader, Transformation tr
else if (!current.states.jumping && !current.states.shooting && !current.states.jumpshot)
index = 4;
}
else if (angle >= -0.75 && !isLeft) //BackRight
{
@ -297,9 +297,6 @@ void RemotePlayer::Render(TextureAtlas& atlas, Shader& shader, Transformation tr
else
index = 15;
std::cout << "BackRight" << std::endl;
}
else if (current.states.jumpshot) {
if (Shooting)
@ -312,6 +309,7 @@ void RemotePlayer::Render(TextureAtlas& atlas, Shader& shader, Transformation tr
else if (!current.states.jumping && !current.states.shooting && !current.states.jumpshot)
index = 6;
}