correction of a small error in the updating of the position of the sprites.

This commit is contained in:
Azra Victor 2021-06-16 00:53:58 +02:00 committed by no
parent ddaf700b55
commit 0fc5db4f58

View File

@ -224,13 +224,12 @@ public class match {
} }
nextFrame(p1,inputsP1); nextFrame(p1,inputsP1);
nextFrame(p2,inputsP2); nextFrame(p2,inputsP2);
updatePos(p1,p1.getPosX()< p2.getPosX());
updatePos(p2,!(p1.getPosX()< p2.getPosX()));
f = p2.getCurrentframe();
objP2.setTextureWrap(f.getSprite()[0], f.getSprite()[1], f.getSprite()[2], f.getSprite()[3]);
objP2.translate(new Vector3f(p2.getPosX()-oldPosXp2,p2.getPosY()-oldPosYp2,0));
boolean p1LooksRight = p1.getPosX() < p2.getPosX(); boolean p1LooksRight = p1.getPosX() < p2.getPosX();
updatePos(p1,p1LooksRight);
updatePos(p2,!p1LooksRight);
if(p1LooksRight) { if(p1LooksRight) {
f = p1.getCurrentframe(); f = p1.getCurrentframe();