From 5d95e2223fb4dddcb710327b76a7e2a31ee9821b Mon Sep 17 00:00:00 2001 From: Azra Victor Date: Thu, 17 Jun 2021 14:26:38 +0200 Subject: [PATCH 1/3] changed data for blue bas frames. Changed main function in that for better testing of correct hitboxes placement. --- .../Characters/Blue/BlueBaseFrames.java | 220 +++++++++++++----- src/gameplay/input/InputBuffer.java | 2 +- 2 files changed, 165 insertions(+), 57 deletions(-) diff --git a/src/gameplay/Characters/Blue/BlueBaseFrames.java b/src/gameplay/Characters/Blue/BlueBaseFrames.java index d7ff88e..c92b837 100644 --- a/src/gameplay/Characters/Blue/BlueBaseFrames.java +++ b/src/gameplay/Characters/Blue/BlueBaseFrames.java @@ -7,6 +7,7 @@ import engine.object.ObjectGl; import gameplay.frames.Frame; import gameplay.hitboxes.*; +import java.lang.reflect.Array; import java.util.ArrayList; public class BlueBaseFrames { @@ -21,7 +22,7 @@ public class BlueBaseFrames { pthb.add(bStandPTHB1); Frame blueStandframe1 = new Frame(0.0,0.0,phb,new ArrayList(),pthb,new ArrayList(), bStandPB1,true,true,true,true,true); - blueStandframe1.setSpriteWrap(0,0,102,120); + blueStandframe1.setSpriteWrap(0,0,138,138); return blueStandframe1; } @@ -35,12 +36,18 @@ public class BlueBaseFrames { pthb.add(bStandPTHB1); Frame blueStandframe1 = new Frame(0.0,0.0,phb,new ArrayList(),pthb,new ArrayList(), bStandPB1,true,true,true,true,true); - blueStandframe1.setSpriteWrap(0,0,102,120); + blueStandframe1.setSpriteWrap(138,0,138,138); return blueStandframe1; } protected static Frame[] blueStandFrames() { - Frame[] sf = {generateStandFrame1(),generateStandFrame2()}; + Frame[] sf = new Frame[6]; + sf[0] = generateStandFrame1(); + sf[1] = generateStandFrame1(); + sf[2] = generateStandFrame1(); + sf[3] = generateStandFrame2(); + sf[4] = generateStandFrame2(); + sf[5] = generateStandFrame2(); return sf; } @@ -54,7 +61,7 @@ public class BlueBaseFrames { pthb.add(bStandPTHB1); Frame blueStandframe1 = new Frame(0.0,0.0,phb,new ArrayList(),pthb,new ArrayList(), bStandPB1,true,true,true,true,true); - blueStandframe1.setSpriteWrap(102,120,102,120); + blueStandframe1.setSpriteWrap(138,138*3,138,138); return blueStandframe1; } @@ -73,7 +80,7 @@ public class BlueBaseFrames { pthb.add(bStandPTHB1); Frame blueStandframe1 = new Frame(18.0,0.0,phb,new ArrayList(),pthb,new ArrayList(), bStandPB1,false,false,false,false,false); - blueStandframe1.setSpriteWrap(816,0,102,120); + blueStandframe1.setSpriteWrap(138*7,0,138,138); return blueStandframe1; } @@ -87,7 +94,7 @@ public class BlueBaseFrames { pthb.add(bStandPTHB1); Frame blueStandframe1 = new Frame(-18.0,0.0,phb,new ArrayList(),pthb,new ArrayList(), bStandPB1,false,false,false,false,false); - blueStandframe1.setSpriteWrap(816,0,102,120); + blueStandframe1.setSpriteWrap(138*7,0,138,138); return blueStandframe1; } @@ -112,11 +119,39 @@ public class BlueBaseFrames { pthb.add(bStandPTHB1); Frame blueStandframe1 = new Frame(18.0,10.0,phb,new ArrayList(),pthb,new ArrayList(), bStandPB1,false,false,false,false,false); - blueStandframe1.setSpriteWrap(816,0,102,120); + blueStandframe1.setSpriteWrap(138*6,0,138,138); return blueStandframe1; } private static Frame GenerateForwardJumpFrame2(){ + Passive_HitBox bStandPHB1 = new Passive_HitBox(70,70,150,500); + Passive_throw_HitBox bStandPTHB1 = new Passive_throw_HitBox(70,400,150,100); + Push_HitBox bStandPB1 = new Push_HitBox(70,70,150,500); + ArrayList phb = new ArrayList(); + ArrayList pthb = new ArrayList(); + phb.add(bStandPHB1); + pthb.add(bStandPTHB1); + Frame blueStandframe1 = new Frame(9.0,10.0,phb,new ArrayList(),pthb,new ArrayList(), + bStandPB1,false,false,false,false,false); + blueStandframe1.setSpriteWrap(138*7,0,138,138); + return blueStandframe1; + } + + private static Frame GenerateForwardJumpFrame3(){ + Passive_HitBox bStandPHB1 = new Passive_HitBox(70,70,150,500); + Passive_throw_HitBox bStandPTHB1 = new Passive_throw_HitBox(70,400,150,100); + Push_HitBox bStandPB1 = new Push_HitBox(70,70,150,500); + ArrayList phb = new ArrayList(); + ArrayList pthb = new ArrayList(); + phb.add(bStandPHB1); + pthb.add(bStandPTHB1); + Frame blueStandframe1 = new Frame(-9.0,10.0,phb,new ArrayList(),pthb,new ArrayList(), + bStandPB1,false,false,false,false,false); + blueStandframe1.setSpriteWrap(138*7,0,138,138); + return blueStandframe1; + } + + private static Frame GenerateForwardJumpFrame4(){ Passive_HitBox bStandPHB1 = new Passive_HitBox(70,70,150,500); Passive_throw_HitBox bStandPTHB1 = new Passive_throw_HitBox(70,400,150,100); Push_HitBox bStandPB1 = new Push_HitBox(70,70,150,500); @@ -126,18 +161,24 @@ public class BlueBaseFrames { pthb.add(bStandPTHB1); Frame blueStandframe1 = new Frame(-18.0,10.0,phb,new ArrayList(),pthb,new ArrayList(), bStandPB1,false,false,false,false,false); - blueStandframe1.setSpriteWrap(816,0,102,120); + blueStandframe1.setSpriteWrap(138*6,0,138,138); return blueStandframe1; } protected static Frame[] blueForwardJump() { Frame[] jF = new Frame[40]; - for(int i = 0; i < jF.length/2; i++) { + for(int i = 0; i < jF.length/4; i++) { jF[i] = GenerateForwardJumpFrame1(); } - for(int i = jF.length/2; i < jF.length; i++) { + for(int i = jF.length/4; i < jF.length/2; i++) { jF[i] = GenerateForwardJumpFrame2(); } + for(int i = jF.length/2; i < jF.length/(3/4); i++) { + jF[i] = GenerateForwardJumpFrame3(); + } + for(int i = jF.length/(3/4); i < jF.length; i++) { + jF[i] = GenerateForwardJumpFrame4(); + } return jF; } @@ -151,21 +192,10 @@ public class BlueBaseFrames { pthb.add(bStandPTHB1); Frame blueStandframe1 = new Frame(18.0,-10.0,phb,new ArrayList(),pthb,new ArrayList(), bStandPB1,false,false,false,false,false); - blueStandframe1.setSpriteWrap(816,0,102,120); + blueStandframe1.setSpriteWrap(138*6,0,138,138); return blueStandframe1; } - protected static Frame[] blueBackJump() { - Frame[] jF = new Frame[40]; - for(int i = 0; i < jF.length/2; i++) { - jF[i] = BackJumpFrame1(); - } - for(int i = jF.length/2; i < jF.length; i++) { - jF[i] = BackJumpFrame2(); - } - return jF; - } - private static Frame BackJumpFrame2(){ Passive_HitBox bStandPHB1 = new Passive_HitBox(70,70,150,500); Passive_throw_HitBox bStandPTHB1 = new Passive_throw_HitBox(70,400,150,100); @@ -174,12 +204,58 @@ public class BlueBaseFrames { ArrayList pthb = new ArrayList(); phb.add(bStandPHB1); pthb.add(bStandPTHB1); - Frame blueStandframe1 = new Frame(-18.0,-10.0,phb,new ArrayList(),pthb,new ArrayList(), + Frame blueStandframe1 = new Frame(9.0,-10.0,phb,new ArrayList(),pthb,new ArrayList(), bStandPB1,false,false,false,false,false); - blueStandframe1.setSpriteWrap(816,0,102,120); + blueStandframe1.setSpriteWrap(138*7,0,138,138); return blueStandframe1; } + private static Frame BackJumpFrame3(){ + Passive_HitBox bStandPHB1 = new Passive_HitBox(70,70,150,500); + Passive_throw_HitBox bStandPTHB1 = new Passive_throw_HitBox(70,400,150,100); + Push_HitBox bStandPB1 = new Push_HitBox(70,70,150,500); + ArrayList phb = new ArrayList(); + ArrayList pthb = new ArrayList(); + phb.add(bStandPHB1); + pthb.add(bStandPTHB1); + Frame blueStandframe1 = new Frame(-9.0,-10.0,phb,new ArrayList(),pthb,new ArrayList(), + bStandPB1,false,false,false,false,false); + blueStandframe1.setSpriteWrap(138*7,0,138,138); + return blueStandframe1; + } + + private static Frame BackJumpFrame4(){ + Passive_HitBox bStandPHB1 = new Passive_HitBox(70,70,150,500); + Passive_throw_HitBox bStandPTHB1 = new Passive_throw_HitBox(70,400,150,100); + Push_HitBox bStandPB1 = new Push_HitBox(70,70,150,500); + ArrayList phb = new ArrayList(); + ArrayList pthb = new ArrayList(); + phb.add(bStandPHB1); + pthb.add(bStandPTHB1); + Frame blueStandframe1 = new Frame(-18.0,-10.0,phb,new ArrayList(),pthb,new ArrayList(), + bStandPB1,false,false,false,false,false); + blueStandframe1.setSpriteWrap(138*6,0,138,138); + return blueStandframe1; + } + + protected static Frame[] blueBackJump() { + Frame[] jF = new Frame[40]; + for(int i = 0; i < jF.length/4; i++) { + jF[i] = BackJumpFrame1(); + } + for(int i = jF.length/4; i < jF.length/2; i++) { + jF[i] = BackJumpFrame2(); + } + for(int i = jF.length/2; i < jF.length/(3/4); i++) { + jF[i] = BackJumpFrame3(); + } + for(int i = jF.length/(3/4); i < jF.length; i++) { + jF[i] = BackJumpFrame4(); + } + return jF; + } + + private static Frame walkForwardFrame1(){ Passive_HitBox bStandPHB1 = new Passive_HitBox(70,70,150,500); Passive_throw_HitBox bStandPTHB1 = new Passive_throw_HitBox(70,400,150,100); @@ -190,7 +266,7 @@ public class BlueBaseFrames { pthb.add(bStandPTHB1); Frame blueStandframe1 = new Frame(0.0,8.0,phb,new ArrayList(),pthb,new ArrayList(), bStandPB1,true,true,true,true,true); - blueStandframe1.setSpriteWrap(204,0,102,120); + blueStandframe1.setSpriteWrap(138*3,0,138,138); return blueStandframe1; } @@ -204,7 +280,7 @@ public class BlueBaseFrames { pthb.add(bStandPTHB1); Frame blueStandframe1 = new Frame(0.0,8.0,phb,new ArrayList(),pthb,new ArrayList(), bStandPB1,true,true,true,true,true); - blueStandframe1.setSpriteWrap(306,0,102,120); + blueStandframe1.setSpriteWrap(138*3,0,138,138); return blueStandframe1; } @@ -218,7 +294,7 @@ public class BlueBaseFrames { pthb.add(bStandPTHB1); Frame blueStandframe1 = new Frame(0.0,8.0,phb,new ArrayList(),pthb,new ArrayList(), bStandPB1,true,true,true,true,true); - blueStandframe1.setSpriteWrap(408,0,102,120); + blueStandframe1.setSpriteWrap(138*4,0,138,138); return blueStandframe1; } @@ -232,7 +308,7 @@ public class BlueBaseFrames { pthb.add(bStandPTHB1); Frame blueStandframe1 = new Frame(0.0,8.0,phb,new ArrayList(),pthb,new ArrayList(), bStandPB1,true,true,true,true,true); - blueStandframe1.setSpriteWrap(510,0,102,120); + blueStandframe1.setSpriteWrap(138*5,0,138,138); return blueStandframe1; } @@ -265,7 +341,7 @@ public class BlueBaseFrames { pthb.add(bStandPTHB1); Frame blueStandframe1 = new Frame(0.0,-8.0,phb,new ArrayList(),pthb,new ArrayList(), bStandPB1,true,true,true,true,true); - blueStandframe1.setSpriteWrap(220,0,112,120); + blueStandframe1.setSpriteWrap(138*5,0,138,138); return blueStandframe1; } @@ -279,7 +355,7 @@ public class BlueBaseFrames { pthb.add(bStandPTHB1); Frame blueStandframe1 = new Frame(0.0,-8.0,phb,new ArrayList(),pthb,new ArrayList(), bStandPB1,true,true,true,true,true); - blueStandframe1.setSpriteWrap(330,0,112,120); + blueStandframe1.setSpriteWrap(138*4,0,138,138); return blueStandframe1; } @@ -293,7 +369,7 @@ public class BlueBaseFrames { pthb.add(bStandPTHB1); Frame blueStandframe1 = new Frame(0.0,-8.0,phb,new ArrayList(),pthb,new ArrayList(), bStandPB1,true,true,true,true,true); - blueStandframe1.setSpriteWrap(420,0,112,120); + blueStandframe1.setSpriteWrap(138*3,0,138,138); return blueStandframe1; } @@ -307,7 +383,7 @@ public class BlueBaseFrames { pthb.add(bStandPTHB1); Frame blueStandframe1 = new Frame(0.0,-8.0,phb,new ArrayList(),pthb,new ArrayList(), bStandPB1,true,true,true,true,true); - blueStandframe1.setSpriteWrap(500,0,112,120); + blueStandframe1.setSpriteWrap(138*3,0,138,138); return blueStandframe1; } @@ -325,37 +401,69 @@ public class BlueBaseFrames { Engine engine = new Engine(640, 480, new Vector3f(4.0f, 3.0f)); engine.init(); - String path = "textures/Sprite.png"; - String pathToBG = "textures/background_beach.png"; + Vector3f BLUE = new Vector3f(0f,0f,1f); //passive_hit + Vector3f RED = new Vector3f(1f,0f,0f); //active_hit + Vector3f GREEN = new Vector3f(0f,1f,0f); //passive_throw + Vector3f YELLOW = new Vector3f(1f,1f,0f); //Active throw + Vector3f PURPLE = new Vector3f(1f,0f,1f); //pushbox + + + String path = "textures/Sprite_sans_grille_9comp.png"; + String pathToBG = "textures/arena1.png"; Frame f = generateStandFrame1(); - ObjectGl blue = new ObjectGl(0f, 60f, 80f, 5f, path, null); + + + ObjectGl blue = new ObjectGl(0f, 138f, 138f, 4f, path, null); blue.setTextureWrap(f.getSprite()[0], f.getSprite()[1], f.getSprite()[2], f.getSprite()[3]); - blue.translate(new Vector3f(-750,200,0)); + int posX = -750; int posY = 200; - engine.add_objectGl(blue); - int counter = 0; - long ts1, ts2; - float posZ = 11; - while(counter < 1000) { - ts1 = System.currentTimeMillis(); - posZ = 11; - engine.update(); - engine.render(); - counter++; - for(Passive_HitBox h: f.getPassHitBox()){ - Hitbox hh = new Hitbox(posZ,h.getSize_x(),h.getSize_y(),5f,new Vector3f(1,0,0)); - engine.add_objectGl(hh); - hh.translate(new Vector3f(-750+h.getPosY(),200+h.getPosY())); - } - blue.translate(new Vector3f(0,0,0)); - ts2 = System.currentTimeMillis(); - while(ts2-ts1 < 1000/20) { - ts2 = System.currentTimeMillis(); - } + blue.translate(new Vector3f(posX,posY,0)); + + engine.add_objectGl(blue); + float posZ = 11f; + + for(Passive_HitBox h: f.getPassHitBox()){ + Hitbox hh = new Hitbox(posZ,h.getSize_x(),h.getSize_y(),1f,BLUE); + engine.add_objectGl(hh); + hh.translate(new Vector3f(posX+h.getPosX(),posY+h.getPosY())); + posZ++; } + for(Active_HitBox h: f.getActHitBox()){ + Hitbox hh = new Hitbox(posZ,h.getSize_x(),h.getSize_y(),1f,RED); + engine.add_objectGl(hh); + hh.translate(new Vector3f(posX+h.getPosX(),posY+h.getPosY())); + posZ++; + } + for(Passive_throw_HitBox h: f.getPassThrowHitBox()){ + Hitbox hh = new Hitbox(posZ,h.getSize_x(),h.getSize_y(),1f,GREEN); + engine.add_objectGl(hh); + hh.translate(new Vector3f(posX+h.getPosX(),posY+h.getPosY())); + posZ++; + } + for(Active_throw_Hitbox h: f.getActThrowHitBox()){ + Hitbox hh = new Hitbox(posZ,h.getSize_x(),h.getSize_y(),1f,YELLOW); + engine.add_objectGl(hh); + hh.translate(new Vector3f(posX+h.getPosX(),posY+h.getPosY())); + posZ++; + } + + Push_HitBox phb = f.getPushHitBox(); + Hitbox hh = new Hitbox(posZ,phb.getSize_x(),phb.getSize_y(),1f,PURPLE); + engine.add_objectGl(hh); + hh.translate(new Vector3f(posX+phb.getPosX(),posY+phb.getPosY())); + + engine.update(); + engine.render(); + + double ts1 = System.currentTimeMillis(); + double ts2 = System.currentTimeMillis(); + while(ts2 - ts1 < 60000) { + ts2 = System.currentTimeMillis(); + } + } } diff --git a/src/gameplay/input/InputBuffer.java b/src/gameplay/input/InputBuffer.java index 9a4a6b6..b4452ac 100644 --- a/src/gameplay/input/InputBuffer.java +++ b/src/gameplay/input/InputBuffer.java @@ -110,7 +110,7 @@ public class InputBuffer { try { ret = this.inputList[pos].containsButtonTab(command[command.length - 1]); } catch (ArrayIndexOutOfBoundsException e ) { - return true; + return false; } for(int i = command.length - 2; i >= 0 && ret; i--) { backCounter = 1; From 3d4eae99112dbdd5310ab474d90039e035c81b51 Mon Sep 17 00:00:00 2001 From: Azra Victor Date: Thu, 17 Jun 2021 14:43:50 +0200 Subject: [PATCH 2/3] Added a comment in blueBaseFrames to copy-past for easier Frame method generation. --- .../Characters/Blue/BlueBaseFrames.java | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/src/gameplay/Characters/Blue/BlueBaseFrames.java b/src/gameplay/Characters/Blue/BlueBaseFrames.java index c92b837..91c58fc 100644 --- a/src/gameplay/Characters/Blue/BlueBaseFrames.java +++ b/src/gameplay/Characters/Blue/BlueBaseFrames.java @@ -12,6 +12,37 @@ import java.util.ArrayList; public class BlueBaseFrames { + /* + TO COPY PASTE FOR EASY frame function generation : + + private static Frame ExampleFrame(){ + //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(70,70,150,500); + + Frame f = new Frame(moveX,moveY,phb,ahb,pthb,athb,bStandPB1,normalC,specialC,jumpC,moveC,dashC); + + //set sprite data on sheet + f.setSpriteWrap(0,0,138,138); + return f; + } + */ private static Frame generateStandFrame1(){ Passive_HitBox bStandPHB1 = new Passive_HitBox(70,70,150,500); Passive_throw_HitBox bStandPTHB1 = new Passive_throw_HitBox(70,400,150,100); From bd517567179c0c79793ef7db5429a1ac971a2ddc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Rativel?= Date: Thu, 17 Jun 2021 15:42:50 +0200 Subject: [PATCH 3/3] Changed some fonction in Blueormals and added functions for crouche C Fierce Added the new attack in CharacterBlue --- src/gameplay/Characters/Blue/BlueNormals.java | 168 ++++++++++++++++-- .../Characters/Blue/CharacterBlue.java | 2 +- 2 files changed, 157 insertions(+), 13 deletions(-) diff --git a/src/gameplay/Characters/Blue/BlueNormals.java b/src/gameplay/Characters/Blue/BlueNormals.java index 5bcbdb2..8b463be 100644 --- a/src/gameplay/Characters/Blue/BlueNormals.java +++ b/src/gameplay/Characters/Blue/BlueNormals.java @@ -27,7 +27,7 @@ public class BlueNormals { pthb.add(bStandPTHB1); Frame blueStandframe1 = new Frame(0.0,0.0,phb,new ArrayList(),pthb,new ArrayList(), bStandPB1,false,false,false,false,false); - blueStandframe1.setSpriteWrap(102,120,102,120); + blueStandframe1.setSpriteWrap(0,(138*2),138,138); return blueStandframe1; } @@ -41,7 +41,7 @@ public class BlueNormals { pthb.add(bStandPTHB1); Frame blueStandframe1 = new Frame(0.0,0.0,phb,new ArrayList(),pthb,new ArrayList(), bStandPB1,false,false,false,false,false); - blueStandframe1.setSpriteWrap(816,120,102,120); + blueStandframe1.setSpriteWrap(138,(138*2),138,138); return blueStandframe1; } @@ -55,7 +55,7 @@ public class BlueNormals { pthb.add(bStandPTHB1); Frame blueStandframe1 = new Frame(0.0,0.0,phb,new ArrayList(),pthb,new ArrayList(), bStandPB1,false,true,false,false,false); - blueStandframe1.setSpriteWrap(102,120,102,120); + blueStandframe1.setSpriteWrap((138*2),(138*2),138,138); return blueStandframe1; } @@ -93,7 +93,115 @@ public class BlueNormals { attackPart[] parts = {blueCrouchAstartup(),blueCrouchAactive(),blueCrouchArecovery()}; return new Attack(isSpecial,rS,cmd,parts); } + + private static Frame crouchCFrame1() { + Passive_HitBox bStandPHB1 = new Passive_HitBox(70,70,150,500); + Passive_throw_HitBox bStandPTHB1 = new Passive_throw_HitBox(70,400,150,100); + Push_HitBox bStandPB1 = new Push_HitBox(70,70,150,500); + ArrayList phb = new ArrayList(); + ArrayList pthb = new ArrayList(); + phb.add(bStandPHB1); + pthb.add(bStandPTHB1); + Frame f = new Frame(0.0,0.0,phb,new ArrayList(),pthb,new ArrayList(), + bStandPB1,false,false,false,false,false); + f.setSpriteWrap((138*6),(138*2),138,138); + return f; + } + + private static Frame crouchCFrame2() { + Passive_HitBox bStandPHB1 = new Passive_HitBox(70,70,150,500); + Passive_throw_HitBox bStandPTHB1 = new Passive_throw_HitBox(70,400,150,100); + Push_HitBox bStandPB1 = new Push_HitBox(70,70,150,500); + ArrayList phb = new ArrayList(); + ArrayList pthb = new ArrayList(); + phb.add(bStandPHB1); + pthb.add(bStandPTHB1); + Frame f = new Frame(0.0,0.0,phb,new ArrayList(),pthb,new ArrayList(), + bStandPB1,false,false,false,false,false); + f.setSpriteWrap((138*7),(138*2),138,138); + return f; + } + + private static Frame crouchCFrame3() { + Passive_HitBox bStandPHB1 = new Passive_HitBox(70,70,150,500); + Passive_throw_HitBox bStandPTHB1 = new Passive_throw_HitBox(70,400,150,100); + Push_HitBox bStandPB1 = new Push_HitBox(70,70,150,500); + ArrayList phb = new ArrayList(); + ArrayList pthb = new ArrayList(); + phb.add(bStandPHB1); + pthb.add(bStandPTHB1); + Frame f = new Frame(0.0,0.0,phb,new ArrayList(),pthb,new ArrayList(), + bStandPB1,false,false,false,false,false); + f.setSpriteWrap((138*8),(138*2),138,138); + return f; + } + + private static Frame crouchCFrame4() { + Passive_HitBox bStandPHB1 = new Passive_HitBox(70,70,150,500); + Passive_throw_HitBox bStandPTHB1 = new Passive_throw_HitBox(70,400,150,100); + Push_HitBox bStandPB1 = new Push_HitBox(70,70,150,500); + ArrayList phb = new ArrayList(); + ArrayList pthb = new ArrayList(); + phb.add(bStandPHB1); + pthb.add(bStandPTHB1); + Frame f = new Frame(0.0,0.0,phb,new ArrayList(),pthb,new ArrayList(), + bStandPB1,false,false,false,false,false); + f.setSpriteWrap((138*9),(138*2),138,138); + return f; + } + + private static Frame crouchCFrame5() { + Passive_HitBox bStandPHB1 = new Passive_HitBox(70,70,150,500); + Passive_throw_HitBox bStandPTHB1 = new Passive_throw_HitBox(70,400,150,100); + Push_HitBox bStandPB1 = new Push_HitBox(70,70,150,500); + ArrayList phb = new ArrayList(); + ArrayList pthb = new ArrayList(); + phb.add(bStandPHB1); + pthb.add(bStandPTHB1); + Frame f = new Frame(0.0,0.0,phb,new ArrayList(),pthb,new ArrayList(), + bStandPB1,false,false,false,false,false); + f.setSpriteWrap((138*10),(138*2),138,138); + return f; + } + + private static attackPart blueCrouchCstartup() { + Frame[] f = new Frame[5]; + f[0] = crouchCFrame1(); + f[1] = crouchCFrame1(); + f[2] = crouchCFrame2(); + f[3] = crouchCFrame2(); + f[4] = crouchCFrame2(); + return(new attackPart(f)); + } + private static attackPart blueCrouchCrecovery() { + Frame[] f = new Frame[19]; + int i; + for(i = 0; i < 10; i++) { + f[i] = crouchCFrame4(); + } + for(int j = i; j < f.length; j++) { + f[j] = crouchCFrame5(); + } + return(new attackPart(f)); + } + + private static attackPart blueCrouchCactive() { + Frame[] f = new Frame[5]; + for(int i = 0; i < f.length; i++) { + f[i] = crouchCFrame3(); + } + return(new attackPart(23,0,13,29,12,5,f,false,false,false)); + } + + public static Attack blueCrouchFierce() { + ButtonIG[][] cmd = {{DOWN,C}}; + boolean isSpecial = false; + Status rS = Status.NORMAL; + attackPart[] parts = {blueCrouchCstartup(),blueCrouchCactive(),blueCrouchCrecovery()}; + return new Attack(isSpecial,rS,cmd,parts); + } + private static Frame standAFrame1(){ /* @@ -123,7 +231,7 @@ public class BlueNormals { Frame f = new Frame(0.0,0.0,phb,ahb,pthb,athb,pushB, //cancels (in order : normal, special, jump, move, dash) false,false,false,false,false); - f.setSpriteWrap(102,0,102,120); + f.setSpriteWrap((138*3),0,138,138); return f; } @@ -156,7 +264,7 @@ public class BlueNormals { Frame f = new Frame(0.0,0.0,phb,ahb,pthb,athb,pushB, //cancels (in order : normal, special, jump, move, dash) false,true,false,false,false); - f.setSpriteWrap(510,120,102,120); + f.setSpriteWrap((138*13),0,138,138); return f; } @@ -189,7 +297,7 @@ public class BlueNormals { Frame f = new Frame(0.0,0.0,phb,ahb,pthb,athb,pushB, //cancels (in order : normal, special, jump, move, dash) false,true,false,false,false); - f.setSpriteWrap(102,0,102,120); + f.setSpriteWrap((138*14),0,138,138); return f; } @@ -256,7 +364,7 @@ public class BlueNormals { Frame f = new Frame(0.0,3.0,phb,ahb,pthb,athb,pushB, //cancels (in order : normal, special, jump, move, dash) false,false,false,false,false); - f.setSpriteWrap(408,0,102,120); + f.setSpriteWrap((138*4),0,138,138); return f; } @@ -289,7 +397,7 @@ public class BlueNormals { Frame f = new Frame(0.0,0.0,phb,ahb,pthb,athb,pushB, //cancels (in order : normal, special, jump, move, dash) false,false,false,false,false); - f.setSpriteWrap(1632,120,102,120); + f.setSpriteWrap((138*10),138,138,138); return f; } @@ -322,22 +430,58 @@ public class BlueNormals { Frame f = new Frame(0.0,0.0,phb,ahb,pthb,athb,pushB, //cancels (in order : normal, special, jump, move, dash) false,false,false,false,false); - f.setSpriteWrap(102,0,102,120); + f.setSpriteWrap((138*9),138,138,138); + return f; + } + + private static Frame standDFrame4(){ + + /* + Hitboxes lists creation + */ + ArrayList phb = new ArrayList(); + ArrayList pthb = new ArrayList(); + ArrayList ahb = new ArrayList(); + ArrayList athb = new ArrayList(); + + /* + Individual hitboxes creation + */ + Passive_HitBox phb1 = new Passive_HitBox(70,70,150,500); + Passive_throw_HitBox pthb1 = new Passive_throw_HitBox(70,400,150,100); + Push_HitBox pushB = new Push_HitBox(70,70,150,500); + + /* + adding hitboxes to lists + */ + phb.add(phb1); + pthb.add(pthb1); + + /* + frame creation + */ + Frame f = new Frame(0.0,3.0,phb,ahb,pthb,athb,pushB, + //cancels (in order : normal, special, jump, move, dash) + false,false,false,false,false); + f.setSpriteWrap((138*10),138,138,138); return f; } private static attackPart blueStandDstartup() { Frame[] f = new Frame[8]; - for(int i = 0; i < f.length; i++) { + for(int i = 0; i < 5; i++) { f[i] = standDFrame1(); } + for(int i = 5; i< f.length; i++) { + f[i] = standDFrame2(); + } return(new attackPart(f)); } private static attackPart blueStandDactive() { Frame[] f = new Frame[5]; for(int i = 0; i < f.length; i++) { - f[i] = standDFrame2(); + f[i] = standDFrame3(); } return(new attackPart(100,0,20,18,16,14,f,false,false,false)); } @@ -345,7 +489,7 @@ public class BlueNormals { private static attackPart blueStandDrecovery() { Frame[] f = new Frame[18]; for(int i = 0; i < f.length; i++) { - f[i] = standDFrame3(); + f[i] = standDFrame4(); } return(new attackPart(f)); } diff --git a/src/gameplay/Characters/Blue/CharacterBlue.java b/src/gameplay/Characters/Blue/CharacterBlue.java index e8ba7c8..c9db4c7 100644 --- a/src/gameplay/Characters/Blue/CharacterBlue.java +++ b/src/gameplay/Characters/Blue/CharacterBlue.java @@ -31,7 +31,7 @@ public class CharacterBlue { Jump nJ = new Jump(njcmd,nJumpF); Jump bJ = new Jump(bjcmd,bJumpF); - Attack[] atks = {blueLDP(),blueCrouchJab(),blueStandHeavyKick(),blueStandJab()}; + Attack[] atks = {blueLDP(),blueCrouchFierce(),blueCrouchJab(),blueStandHeavyKick(),blueStandJab()}; /* * Temporary values to change later