diff --git a/shaders/StylishShaders/HorizontalProgressBarGradientSquareFrag.glsl b/shaders/StylishShaders/HorizontalProgressBarGradientSquareFrag.glsl index edad87e..8560e3c 100644 --- a/shaders/StylishShaders/HorizontalProgressBarGradientSquareFrag.glsl +++ b/shaders/StylishShaders/HorizontalProgressBarGradientSquareFrag.glsl @@ -15,7 +15,7 @@ void main() vec4 colorTemp = color; float ouverture = 0.8f; // Effet "tube" - float lum = -pow(fragCoord.y + height/2f, 2f) * 5f /height + ouverture; + float lum = -pow(fragCoord.y + height/2.0f, 2.0f) * 5.0f /height + ouverture; colorTemp.xyz *= lum; // Effet flash sur la surface @@ -27,14 +27,14 @@ void main() FragColor = colorTemp; } else { - FragColor = vec4(0f); + FragColor = vec4(0.0f); } } else { if (fill < fragCoord.x){ FragColor = colorTemp; } else { - FragColor = vec4(0f); + FragColor = vec4(0.0f); } } diff --git a/src/engine/input/GamepadInput.java b/src/engine/input/GamepadInput.java index 77b3b25..47bbe9f 100644 --- a/src/engine/input/GamepadInput.java +++ b/src/engine/input/GamepadInput.java @@ -107,8 +107,8 @@ public class GamepadInput { return new Vector3f(x,y); } - public int getGamepadName(){ - return this.gamepadNum; + public String getGamepadName(){ + return glfwGetGamepadName(this.gamepadNum); } } diff --git a/src/gameplay/Characters/Blue/BlueBaseFrames.java b/src/gameplay/Characters/Blue/BlueBaseFrames.java index 192de90..2baf8db 100644 --- a/src/gameplay/Characters/Blue/BlueBaseFrames.java +++ b/src/gameplay/Characters/Blue/BlueBaseFrames.java @@ -1022,8 +1022,7 @@ public class BlueBaseFrames { String path = "textures/Sprite_sans_grille_9comp.png"; String pathToBG = "textures/arena1.png"; - Frame f = BlueNormals.crouchAFrame1(); - + Frame f = BlueNormals.crouchDFrame2(); ObjectGl blue = new ObjectGl(0f, 138f, 138f, 5f, path, null); blue.setTextureWrap(f.getSprite()[0], f.getSprite()[1], f.getSprite()[2], f.getSprite()[3]); diff --git a/src/gameplay/Characters/Blue/BlueNormals.java b/src/gameplay/Characters/Blue/BlueNormals.java index d24b376..a93a719 100644 --- a/src/gameplay/Characters/Blue/BlueNormals.java +++ b/src/gameplay/Characters/Blue/BlueNormals.java @@ -342,7 +342,7 @@ public class BlueNormals { return new Attack(isSpecial,rS,cmd,parts); } - private static Frame crouchBFrame1() { + protected static Frame crouchBFrame1() { //movement data double moveX = 0.0; double moveY = 0.0; @@ -361,16 +361,22 @@ public class BlueNormals { ArrayList pthb = new ArrayList(); //generate hitboxes here and then use ArrayList add method to add them to the correct list - Push_HitBox pB1 = new Push_HitBox(200,-150,160,400); + Push_HitBox pB1 = new Push_HitBox(140*1.25f,-250*1.25f,280*1.25f,300*1.25f); + Passive_HitBox phb1 = new Passive_HitBox(200*1.25f,-250*1.25f,200*1.25f,300*1.25f); + Passive_HitBox phb2 = new Passive_HitBox(260*1.25f,-200*1.25f,80*1.25f,50*1.25f); + Passive_throw_HitBox pthb1 = new Passive_throw_HitBox(150*1.25f,-500*1.25f,300*1.25f,70*1.25f); + pthb.add(pthb1); + phb.add(phb1); + phb.add(phb2); Frame f = new Frame(moveY,moveX,phb,ahb,pthb,athb,pB1,normalC,specialC,jumpC,moveC,dashC); //set sprite data on sheet - f.setSpriteWrap((138*2),0,138,138); + f.setSpriteWrap(0,138*2,138,138); return f; } - private static Frame crouchBFrame2() { + protected static Frame crouchBFrame2() { //movement data double moveX = 8.0; double moveY = 0.0; @@ -389,16 +395,23 @@ public class BlueNormals { ArrayList pthb = new ArrayList(); //generate hitboxes here and then use ArrayList add method to add them to the correct list - Push_HitBox pB1 = new Push_HitBox(200,-150,160,400); - + Push_HitBox pB1 = new Push_HitBox(140*1.25f,-250*1.25f,280*1.25f,300*1.25f); + Passive_HitBox phb1 = new Passive_HitBox(200*1.25f,-250*1.25f,200*1.25f,300*1.25f); + Passive_HitBox phb2 = new Passive_HitBox(260*1.25f,-200*1.25f,80*1.25f,50*1.25f); + Passive_throw_HitBox pthb1 = new Passive_throw_HitBox(150*1.25f,-500*1.25f,300*1.25f,70*1.25f); + Active_HitBox ahb1 = new Active_HitBox(400,-580,200,100); + pthb.add(pthb1); + phb.add(phb1); + phb.add(phb2); + ahb.add(ahb1); Frame f = new Frame(moveY,moveX,phb,ahb,pthb,athb,pB1,normalC,specialC,jumpC,moveC,dashC); //set sprite data on sheet - f.setSpriteWrap((138*4),(138*14),138,138); + f.setSpriteWrap((138*14),(138*4),138,138); return f; } - private static Frame crouchBFrame3() { + protected static Frame crouchBFrame3() { //movement data double moveX = 8.0; double moveY = 0.0; @@ -417,12 +430,18 @@ public class BlueNormals { ArrayList pthb = new ArrayList(); //generate hitboxes here and then use ArrayList add method to add them to the correct list - Push_HitBox pB1 = new Push_HitBox(200,-150,160,400); + Push_HitBox pB1 = new Push_HitBox(140*1.25f,-250*1.25f,280*1.25f,300*1.25f); + Passive_HitBox phb1 = new Passive_HitBox(200*1.25f,-250*1.25f,200*1.25f,300*1.25f); + Passive_HitBox phb2 = new Passive_HitBox(260*1.25f,-200*1.25f,80*1.25f,50*1.25f); + Passive_throw_HitBox pthb1 = new Passive_throw_HitBox(150*1.25f,-500*1.25f,300*1.25f,70*1.25f); + pthb.add(pthb1); + phb.add(phb1); + phb.add(phb2); Frame f = new Frame(moveY,moveX,phb,ahb,pthb,athb,pB1,normalC,specialC,jumpC,moveC,dashC); //set sprite data on sheet - f.setSpriteWrap((138*2),0,138,138); + f.setSpriteWrap(0,138*2,138,138); return f; } @@ -460,7 +479,7 @@ public class BlueNormals { return new Attack(isSpecial,rS,cmd,parts); } - private static Frame crouchDFrame1() { + protected static Frame crouchDFrame1() { //movement data double moveX = 0.0; double moveY = 0.0; @@ -479,16 +498,22 @@ public class BlueNormals { ArrayList pthb = new ArrayList(); //generate hitboxes here and then use ArrayList add method to add them to the correct list - Push_HitBox pB1 = new Push_HitBox(200,-150,160,400); + Push_HitBox pB1 = new Push_HitBox(140*1.25f,-250*1.25f,280*1.25f,300*1.25f); + Passive_HitBox phb1 = new Passive_HitBox(200*1.25f,-250*1.25f,200*1.25f,300*1.25f); + Passive_HitBox phb2 = new Passive_HitBox(260*1.25f,-200*1.25f,80*1.25f,50*1.25f); + Passive_throw_HitBox pthb1 = new Passive_throw_HitBox(150*1.25f,-500*1.25f,300*1.25f,70*1.25f); + pthb.add(pthb1); + phb.add(phb1); + phb.add(phb2); Frame f = new Frame(moveY,moveX,phb,ahb,pthb,athb,pB1,normalC,specialC,jumpC,moveC,dashC); //set sprite data on sheet - f.setSpriteWrap((138*7),(138*5),138,138); + f.setSpriteWrap((138*5),(138*7),138,138); return f; } - private static Frame crouchDFrame2() { + protected static Frame crouchDFrame2() { //movement data double moveX = 0.0; double moveY = 0.0; @@ -507,16 +532,24 @@ public class BlueNormals { ArrayList pthb = new ArrayList(); //generate hitboxes here and then use ArrayList add method to add them to the correct list - Push_HitBox pB1 = new Push_HitBox(200,-150,160,400); + Push_HitBox pB1 = new Push_HitBox(120,-250*1.25f,250,300*1.25f); + Passive_HitBox phb1 = new Passive_HitBox(100,-250*1.25f,200*1.25f,300*1.25f); + Passive_HitBox phb2 = new Passive_HitBox(260*1.25f,-550,300,100); + Passive_throw_HitBox pthb1 = new Passive_throw_HitBox(150*1.25f,-500*1.25f,300*1.25f,70*1.25f); + Active_HitBox ahb1 = new Active_HitBox(300,-500,400,200); + pthb.add(pthb1); + phb.add(phb1); + phb.add(phb2); + ahb.add(ahb1); Frame f = new Frame(moveY,moveX,phb,ahb,pthb,athb,pB1,normalC,specialC,jumpC,moveC,dashC); //set sprite data on sheet - f.setSpriteWrap((138*7),(138*6),138,138); + f.setSpriteWrap((138*6),(138*7),138,138); return f; } - private static Frame crouchDFrame3() { + protected static Frame crouchDFrame3() { //movement data double moveX = 0.0; double moveY = 0.0; @@ -535,7 +568,13 @@ public class BlueNormals { ArrayList pthb = new ArrayList(); //generate hitboxes here and then use ArrayList add method to add them to the correct list - Push_HitBox pB1 = new Push_HitBox(200,-150,160,400); + Push_HitBox pB1 = new Push_HitBox(140*1.25f,-250*1.25f,280*1.25f,300*1.25f); + Passive_HitBox phb1 = new Passive_HitBox(200*1.25f,-250*1.25f,200*1.25f,300*1.25f); + Passive_HitBox phb2 = new Passive_HitBox(260*1.25f,-200*1.25f,80*1.25f,50*1.25f); + Passive_throw_HitBox pthb1 = new Passive_throw_HitBox(150*1.25f,-500*1.25f,300*1.25f,70*1.25f); + pthb.add(pthb1); + phb.add(phb1); + phb.add(phb2); Frame f = new Frame(moveY,moveX,phb,ahb,pthb,athb,pB1,normalC,specialC,jumpC,moveC,dashC); @@ -544,7 +583,7 @@ public class BlueNormals { return f; } - private static Frame crouchDFrame4() { + protected static Frame crouchDFrame4() { //movement data double moveX = 0.0; double moveY = 0.0; @@ -563,12 +602,22 @@ public class BlueNormals { ArrayList pthb = new ArrayList(); //generate hitboxes here and then use ArrayList add method to add them to the correct list - Push_HitBox pB1 = new Push_HitBox(200,-150,160,400); + Push_HitBox pB1 = new Push_HitBox(140*1.25f,-250*1.25f,280*1.25f,300*1.25f); + Passive_HitBox phb1 = new Passive_HitBox(100*1.25f,-250*1.25f,200*1.25f,300*1.25f); + Passive_HitBox phb2 = new Passive_HitBox(260*1.25f,-200*1.25f,80*1.25f,50*1.25f); + Passive_throw_HitBox pthb1 = new Passive_throw_HitBox(100*1.25f,-500*1.25f,300*1.25f,70*1.25f); + pB1.reverseHorizontally(); + phb1.reverseHorizontally(); + phb2.reverseHorizontally(); + pthb1.reverseHorizontally(); + pthb.add(pthb1); + phb.add(phb1); + phb.add(phb2); Frame f = new Frame(moveY,moveX,phb,ahb,pthb,athb,pB1,normalC,specialC,jumpC,moveC,dashC); //set sprite data on sheet - f.setSpriteWrap((138*7),(138*8),138,138); + f.setSpriteWrap((138*8),(138*7),138,138); return f; } @@ -595,7 +644,7 @@ public class BlueNormals { private static attackPart blueCrouchDactive() { Frame[] f = new Frame[6]; for(int i = 0; i < f.length; i++) { - f[i] = crouchAFrame2(); + f[i] = crouchDFrame2(); } return(new attackPart(120,0,31,10,30,15,f,true,false,true)); } @@ -743,7 +792,7 @@ public class BlueNormals { return new Attack(isSpecial,rS,cmd,parts); } - private static Frame StandCFrame1() { + protected static Frame StandCFrame1() { //movement data double moveX = 0.0; double moveY = 0.0; @@ -761,17 +810,33 @@ public class BlueNormals { ArrayList phb = new ArrayList(); ArrayList pthb = new ArrayList(); - //generate hitboxes here and then use ArrayList add method to add them to the correct list - Push_HitBox pB1 = new Push_HitBox(200,-150,160,400); + /* + Individual hitboxes creation + */ + Passive_HitBox phb1 = new Passive_HitBox(200*1.25f,-200*1.25f,150*1.25f,150*1.25f); + Passive_HitBox phb2 = new Passive_HitBox(220*1.25f,-300*1.25f,100*1.25f,150*1.25f); + Passive_HitBox phb3 = new Passive_HitBox(200*1.25f,-400*1.25f,150*1.25f,150*1.25f); + Passive_HitBox phb4 = new Passive_HitBox(280*1.25f,-150*1.25f,50*1.25f,50*1.25f); + Passive_throw_HitBox pthb1 = new Passive_throw_HitBox(150*1.25f,-500*1.25f,220*1.25f,70*1.25f); + Push_HitBox pushb = new Push_HitBox(200*1.25f,-150*1.25f,160*1.25f,400*1.25f); - Frame f = new Frame(moveY,moveX,phb,ahb,pthb,athb,pB1,normalC,specialC,jumpC,moveC,dashC); + /* + adding hitboxes to lists + */ + phb.add(phb1); + phb.add(phb2); + phb.add(phb3); + phb.add(phb4); + pthb.add(pthb1); + + Frame f = new Frame(moveY,moveX,phb,ahb,pthb,athb,pushb,normalC,specialC,jumpC,moveC,dashC); //set sprite data on sheet f.setSpriteWrap(0,0,138,138); return f; } - private static Frame StandCFrame2() { + protected static Frame StandCFrame2() { //movement data double moveX = 0.0; double moveY = 0.0; @@ -788,18 +853,33 @@ public class BlueNormals { ArrayList athb = new ArrayList(); ArrayList phb = new ArrayList(); ArrayList pthb = new ArrayList(); + /* + Individual hitboxes creation + */ + Passive_HitBox phb1 = new Passive_HitBox(200*1.25f,-150*1.25f,200*1.25f,180*1.25f); + Passive_HitBox phb2 = new Passive_HitBox(220*1.25f,-300*1.25f,100*1.25f,150*1.25f); + Passive_HitBox phb3 = new Passive_HitBox(200*1.25f,-350*1.25f,200*1.25f,200*1.25f); + Passive_HitBox phb4 = new Passive_HitBox(250*1.25f,-120*1.25f,70*1.25f,80*1.25f); + Passive_throw_HitBox pthb1 = new Passive_throw_HitBox(150*1.25f,-500*1.25f,220*1.25f,70*1.25f); + Push_HitBox pushb = new Push_HitBox(200*1.25f,-150*1.25f,160*1.25f,400*1.25f); - //generate hitboxes here and then use ArrayList add method to add them to the correct list - Push_HitBox pB1 = new Push_HitBox(200,-150,160,400); + /* + adding hitboxes to lists + */ + phb.add(phb1); + phb.add(phb2); + phb.add(phb3); + phb.add(phb4); + pthb.add(pthb1); - Frame f = new Frame(moveY,moveX,phb,ahb,pthb,athb,pB1,normalC,specialC,jumpC,moveC,dashC); + Frame f = new Frame(moveY,moveX,phb,ahb,pthb,athb,pushb,normalC,specialC,jumpC,moveC,dashC); //set sprite data on sheet - f.setSpriteWrap((138*3),(138*2),138,138); + f.setSpriteWrap((138*2),(138*3),138,138); return f; } - private static Frame StandCFrame3() { + protected static Frame StandCFrame3() { //movement data double moveX = 0.0; double moveY = 0.0; @@ -817,17 +897,35 @@ public class BlueNormals { ArrayList phb = new ArrayList(); ArrayList pthb = new ArrayList(); - //generate hitboxes here and then use ArrayList add method to add them to the correct list - Push_HitBox pB1 = new Push_HitBox(200,-150,160,400); + /* + Individual hitboxes creation + */ + Passive_HitBox phb1 = new Passive_HitBox(200*1.25f,-150*1.25f,200*1.25f,200*1.25f); + Passive_HitBox phb2 = new Passive_HitBox(220*1.25f,-300*1.25f,100*1.25f,150*1.25f); + Passive_HitBox phb3 = new Passive_HitBox(200*1.25f,-350*1.25f,170*1.25f,200*1.25f); + Passive_HitBox phb4 = new Passive_HitBox(250*1.25f,-200*1.25f,80*1.25f,50*1.25f); + Passive_throw_HitBox pthb1 = new Passive_throw_HitBox(150*1.25f,-500*1.25f,250*1.25f,70*1.25f); + Push_HitBox pushb = new Push_HitBox(200*1.25f,-150*1.25f,160*1.25f,400*1.25f); + Active_HitBox ahb1 = new Active_HitBox(350,-220,250,130); + /* + adding hitboxes to lists + */ + phb.add(phb1); + phb.add(phb2); + phb.add(phb3); + phb.add(phb4); + pthb.add(pthb1); + ahb.add(ahb1); - Frame f = new Frame(moveY,moveX,phb,ahb,pthb,athb,pB1,normalC,specialC,jumpC,moveC,dashC); + + Frame f = new Frame(moveY,moveX,phb,ahb,pthb,athb,pushb,normalC,specialC,jumpC,moveC,dashC); //set sprite data on sheet - f.setSpriteWrap(138,(138*6),138,138); + f.setSpriteWrap(138*6,138,138,138); return f; } - private static Frame StandCFrame4() { + protected static Frame StandCFrame4() { //movement data double moveX = 0.0; double moveY = 0.0; @@ -845,10 +943,27 @@ public class BlueNormals { ArrayList phb = new ArrayList(); ArrayList pthb = new ArrayList(); - //generate hitboxes here and then use ArrayList add method to add them to the correct list - Push_HitBox pB1 = new Push_HitBox(200,-150,160,400); + /* + Individual hitboxes creation + */ + Passive_HitBox phb1 = new Passive_HitBox(200*1.25f,-200*1.25f,150*1.25f,150*1.25f); + Passive_HitBox phb2 = new Passive_HitBox(220*1.25f,-300*1.25f,100*1.25f,150*1.25f); + Passive_HitBox phb3 = new Passive_HitBox(200*1.25f,-400*1.25f,150*1.25f,150*1.25f); + Passive_HitBox phb4 = new Passive_HitBox(280*1.25f,-150*1.25f,50*1.25f,50*1.25f); + Passive_throw_HitBox pthb1 = new Passive_throw_HitBox(150*1.25f,-500*1.25f,220*1.25f,70*1.25f); + Push_HitBox pushb = new Push_HitBox(200*1.25f,-150*1.25f,160*1.25f,400*1.25f); - Frame f = new Frame(moveY,moveX,phb,ahb,pthb,athb,pB1,normalC,specialC,jumpC,moveC,dashC); + /* + adding hitboxes to lists + */ + phb.add(phb1); + phb.add(phb2); + phb.add(phb3); + phb.add(phb4); + pthb.add(pthb1); + + + Frame f = new Frame(moveY,moveX,phb,ahb,pthb,athb,pushb,normalC,specialC,jumpC,moveC,dashC); //set sprite data on sheet f.setSpriteWrap(138,(138*7),138,138); @@ -1245,7 +1360,7 @@ public class BlueNormals { - private static Frame ForwardDFrame0() { + protected static Frame ForwardDFrame0() { //movement data double moveX = 3.0; double moveY = 0.0; @@ -1264,7 +1379,12 @@ public class BlueNormals { ArrayList pthb = new ArrayList(); //generate hitboxes here and then use ArrayList add method to add them to the correct list - Push_HitBox bStandPB1 = new Push_HitBox(70,70,150,500); + Push_HitBox bStandPB1 = new Push_HitBox(200,-100,250,550); + Passive_throw_HitBox pthb1 = new Passive_throw_HitBox(200,-600,250,120); + Passive_HitBox phb1 = new Passive_HitBox(230, -100, 200, 550); + + pthb.add(pthb1); + phb.add(phb1); Frame f = new Frame(moveY,moveX,phb,ahb,pthb,athb,bStandPB1,normalC,specialC,jumpC,moveC,dashC); @@ -1291,7 +1411,12 @@ public class BlueNormals { ArrayList pthb = new ArrayList(); //generate hitboxes here and then use ArrayList add method to add them to the correct list - Push_HitBox bStandPB1 = new Push_HitBox(70,70,150,500); + Push_HitBox bStandPB1 = new Push_HitBox(200,-100,250,550); + Passive_throw_HitBox pthb1 = new Passive_throw_HitBox(200,-600,250,120); + Passive_HitBox phb1 = new Passive_HitBox(230, -100, 200, 550); + + pthb.add(pthb1); + phb.add(phb1); Frame f = new Frame(moveY,moveX,phb,ahb,pthb,athb,bStandPB1,normalC,specialC,jumpC,moveC,dashC); @@ -1319,7 +1444,15 @@ public class BlueNormals { ArrayList pthb = new ArrayList(); //generate hitboxes here and then use ArrayList add method to add them to the correct list - Push_HitBox bStandPB1 = new Push_HitBox(70,70,150,500); + Push_HitBox bStandPB1 = new Push_HitBox(200,-100,250,550); + Passive_throw_HitBox pthb1 = new Passive_throw_HitBox(200,-600,250,120); + Passive_HitBox phb1 = new Passive_HitBox(230, -100, 200, 550); + Passive_HitBox phb2 = new Passive_HitBox(400, -200, 200, 170); + + + pthb.add(pthb1); + phb.add(phb1); + phb.add(phb2); Frame f = new Frame(moveY,moveX,phb,ahb,pthb,athb,bStandPB1,normalC,specialC,jumpC,moveC,dashC); @@ -1347,7 +1480,14 @@ public class BlueNormals { ArrayList pthb = new ArrayList(); //generate hitboxes here and then use ArrayList add method to add them to the correct list - Push_HitBox bStandPB1 = new Push_HitBox(70,70,150,500); + Push_HitBox bStandPB1 = new Push_HitBox(200,-100,180,550); + Passive_throw_HitBox pthb1 = new Passive_throw_HitBox(200,-600,250,120); + Passive_HitBox phb1 = new Passive_HitBox(200,-100,180,550); + Active_HitBox ahb1 = new Active_HitBox(300,-60,250,300); + + pthb.add(pthb1); + phb.add(phb1); + ahb.add(ahb1); Frame f = new Frame(moveY,moveX,phb,ahb,pthb,athb,bStandPB1,normalC,specialC,jumpC,moveC,dashC); @@ -1375,7 +1515,49 @@ public class BlueNormals { ArrayList pthb = new ArrayList(); //generate hitboxes here and then use ArrayList add method to add them to the correct list - Push_HitBox bStandPB1 = new Push_HitBox(70,70,150,500); + Push_HitBox bStandPB1 = new Push_HitBox(200,-100,180,550); + Passive_throw_HitBox pthb1 = new Passive_throw_HitBox(200,-600,250,120); + Passive_HitBox phb1 = new Passive_HitBox(200,-100,180,550); + Active_HitBox ahb1 = new Active_HitBox(300,-160,250,300); + + pthb.add(pthb1); + phb.add(phb1); + ahb.add(ahb1); + + Frame f = new Frame(moveY,moveX,phb,ahb,pthb,athb,bStandPB1,normalC,specialC,jumpC,moveC,dashC); + + //set sprite data on sheet + f.setSpriteWrap((138*12),138,138,138); + return f; + } + + protected static Frame ForwardDFrame6(){ + //movement data + double moveX = 0.0; + double moveY = 0.0; + + //cancelData + boolean normalC = false; + boolean specialC = false; + boolean jumpC = false; + boolean moveC = false; + boolean dashC = false; + + //hitbox lists + ArrayList ahb = new ArrayList(); + ArrayList athb = new ArrayList(); + ArrayList phb = new ArrayList(); + ArrayList pthb = new ArrayList(); + + //generate hitboxes here and then use ArrayList add method to add them to the correct list + Push_HitBox bStandPB1 = new Push_HitBox(200,-100,180,550); + Passive_throw_HitBox pthb1 = new Passive_throw_HitBox(200,-600,250,120); + Passive_HitBox phb1 = new Passive_HitBox(200,-100,180,550); + Passive_HitBox ahb1 = new Passive_HitBox(300,-160,250,300); + + pthb.add(pthb1); + phb.add(phb1); + phb.add(ahb1); Frame f = new Frame(moveY,moveX,phb,ahb,pthb,athb,bStandPB1,normalC,specialC,jumpC,moveC,dashC); @@ -1403,7 +1585,12 @@ public class BlueNormals { ArrayList pthb = new ArrayList(); //generate hitboxes here and then use ArrayList add method to add them to the correct list - Push_HitBox bStandPB1 = new Push_HitBox(70,70,150,500); + Push_HitBox bStandPB1 = new Push_HitBox(200,-100,250,550); + Passive_throw_HitBox pthb1 = new Passive_throw_HitBox(200,-600,250,120); + Passive_HitBox phb1 = new Passive_HitBox(230, -100, 200, 550); + + pthb.add(pthb1); + phb.add(phb1); Frame f = new Frame(moveY,moveX,phb,ahb,pthb,athb,bStandPB1,normalC,specialC,jumpC,moveC,dashC); @@ -1429,7 +1616,7 @@ public class BlueNormals { protected static attackPart blueForwardDrecovery() { Frame[] f = new Frame[8]; for (int i = 0; i < 3; i++) { - f[i] = ForwardDFrame4(); + f[i] = ForwardDFrame6(); } for (int i = 3; i < f.length; i++) { f[i] = ForwardDFrame5(); diff --git a/src/gameplay/frames/Frame.java b/src/gameplay/frames/Frame.java index 2d0421b..f9086a9 100644 --- a/src/gameplay/frames/Frame.java +++ b/src/gameplay/frames/Frame.java @@ -232,15 +232,10 @@ public class Frame { * @param f the frame to clone */ public void cloneWithoutMovement(Frame f) { - this.cloneArray(f); //Il faut cloner individuellement chaque hitbox des differentes listes pour ne pas garder les pointeurs - Push_HitBox phb = f.getPushHitBox(); - this.setPushHitBox(new Push_HitBox(phb.getPosX(), phb.getPosY(), phb.getSize_x(), phb.getSize_y())); - this.normalCancellable = f.isNormalCancellable(); - this.specialCancellable = f.isSpecialCancellable(); - this.jumpCancellable = f.jumpCancellable; - this.moveCancellable = f.isMoveCancellable(); - this.isDashCancellable = f.isDashCancellable; - this.lastFrameOfHit = f.islastFrameOfHit(); - this.setSpriteWrap(f.sprite[0], f.sprite[1], f.sprite[2], f.sprite[3]); + double moveX = this.move_x; + double moveY = this.move_y; + this.clone(f); + this.setMove_x(moveX); + this.setMove_y(moveY); } } diff --git a/src/gameplay/frames/nextFrameBuffer.java b/src/gameplay/frames/nextFrameBuffer.java index c87919f..6d6cb3f 100644 --- a/src/gameplay/frames/nextFrameBuffer.java +++ b/src/gameplay/frames/nextFrameBuffer.java @@ -24,8 +24,21 @@ public class nextFrameBuffer { } public void clone(nextFrameBuffer f) { - this.current = f.current; - this.next = f.next; + + try{ + Frame cf = new Frame(); + cf.clone(f.current); + this.current = cf; } + catch (NullPointerException n) { + this.current = null; + this.next = null; + } + nextFrameBuffer nfb = new nextFrameBuffer(); + try { + nfb.clone(f.next); + } catch (NullPointerException n) {} + this.next = nfb; + } public void setNext(nextFrameBuffer f) { @@ -88,14 +101,14 @@ public class nextFrameBuffer { nextFrameBuffer fb = new nextFrameBuffer(); fb.clone(this); this.emptyQueue(); - try{fb.goToNext();} catch(IndexOutOfBoundsException e) {goOn = false;} + try{fb.goToNext();} catch(NullPointerException e) {goOn = false;} while(goOn && i < f.size()) { try{ fb.current.cloneWithoutMovement(f.get(i)); this.addFrameToQueue(fb.current); fb.goToNext(); i++; - } catch(IndexOutOfBoundsException e) { goOn = false;} + } catch(NullPointerException e) { goOn = false;} } } diff --git a/src/gameplay/match/match.java b/src/gameplay/match/match.java index 97c26fe..12c9c61 100644 --- a/src/gameplay/match/match.java +++ b/src/gameplay/match/match.java @@ -82,9 +82,10 @@ public class match { private static UIElementText timerUI; private static UIElementText fpsCounter; private static UIInputList inputListP1; + private static UIElementText roundWon; // Debug - public static boolean showP1Hitbox = false; + public static boolean showP1Hitbox = false; // TODO modifier pour le rendre activable public static boolean showP2Hitbox = false; private static List listHitboxObj = new ArrayList<>(); private static float slowFactor = 1f; @@ -129,14 +130,43 @@ public class match { * Ends the round. * Used for playing animations and such. * TODO : Implement this once we know what to do. + * @throws InterruptedException */ - private static void endRound() { + private static void endRound() throws InterruptedException { if(roundP1) { + //texte de victoire System.out.println("P1 won the round"); + roundWon = new UIElementText("Player1 won the round", 5f, 0.25f, 0.5f, 100f, engine); + roundWon.setBackground(new Vector3f(0f,0f,0f)); + engine.add_uiElement(roundWon); + engine.update(); + engine.render(); + Thread.sleep(1000); + engine.remove_uiElement(roundWon); + + //replacement des sprites + objP1.translate(new Vector3f(-p1.getPosX(), -p1.getPosY())); + objP2.translate(new Vector3f(-p2.getPosX(), -p2.getPosY())); + objP1.getShadow().translate(new Vector3f(0f,-p1.getPosY(),0)); + objP2.getShadow().translate(new Vector3f(0f,-p2.getPosY(),0)); } else { + //texte de victoire System.out.println("P2 won the round"); + roundWon = new UIElementText("Player2 won the round", 5f, 0.25f, 0.5f, 100f, engine); + roundWon.setBackground(new Vector3f(0f,0f,0f)); + engine.add_uiElement(roundWon); + engine.update(); + engine.render(); + Thread.sleep(1000); + engine.remove_uiElement(roundWon); + + //replacement des sprites + objP1.translate(new Vector3f(-p1.getPosX(), -p1.getPosY())); + objP2.translate(new Vector3f(-p2.getPosX(), -p2.getPosY())); + objP1.getShadow().translate(new Vector3f(0f,-p1.getPosY(),0)); + objP2.getShadow().translate(new Vector3f(0f,-p2.getPosY(),0)); } } @@ -299,7 +329,7 @@ public class match { } - private static void ac(int i) { + private static void ac(int i) throws InterruptedException { // System.out.println(i); switch (i) {