diff --git a/SQCSim2021/remoteplayer.cpp b/SQCSim2021/remoteplayer.cpp index 4f796fa..2ee8e38 100644 --- a/SQCSim2021/remoteplayer.cpp +++ b/SQCSim2021/remoteplayer.cpp @@ -126,14 +126,20 @@ void RemotePlayer::Render(TextureAtlas& atlas, Shader& shader, Transformation tr time += elapsedTime; if (time >= 200) { - time -= 200; - Shooting = !Shooting; - } + time -= 200; + if (!current.states.shooting) + Shooting = false; + else { + Shooting = !Shooting; + } + } + bool isLeft = side.y > 0; if (angle >= 0.75) //Face //side positif { + if(current.states.shooting){ if (Shooting) @@ -152,10 +158,13 @@ void RemotePlayer::Render(TextureAtlas& atlas, Shader& shader, Transformation tr else if (current.states.running && current.states.still) index = 0; + + } else if (angle >= 0.25 && isLeft) //Frontleft { - + + if (current.states.shooting) { if (Shooting) index = 18; @@ -176,6 +185,8 @@ void RemotePlayer::Render(TextureAtlas& atlas, Shader& shader, Transformation tr } else if (angle >= -0.25 && isLeft) //ProfileLeft { + + if (current.states.shooting) { if (Shooting) index = 20; @@ -196,6 +207,8 @@ void RemotePlayer::Render(TextureAtlas& atlas, Shader& shader, Transformation tr } else if (angle >= -0.75 && isLeft) //BackLeft { + + if (current.states.shooting) { if (Shooting) index = 22; @@ -215,6 +228,8 @@ void RemotePlayer::Render(TextureAtlas& atlas, Shader& shader, Transformation tr } else if (angle < -0.75) //Dos //side négatif { + + if (current.states.shooting) { if (Shooting) index = 24; @@ -236,6 +251,7 @@ void RemotePlayer::Render(TextureAtlas& atlas, Shader& shader, Transformation tr else if (angle >= 0.25 && !isLeft) //FrontRight { + if (current.states.shooting) { if (Shooting) index = 19; @@ -256,6 +272,8 @@ void RemotePlayer::Render(TextureAtlas& atlas, Shader& shader, Transformation tr } else if (angle >= -0.25 && !isLeft) //ProfileRight { + + if (current.states.shooting) { if (Shooting) index = 21; @@ -276,6 +294,8 @@ void RemotePlayer::Render(TextureAtlas& atlas, Shader& shader, Transformation tr } else if (angle >= -0.75 && !isLeft) //BackRight { + + if (current.states.shooting) { if (Shooting) index = 23;