diff --git a/core/assets/cam/arriba1.png b/core/assets/cam/arriba1.png new file mode 100644 index 0000000..58543be Binary files /dev/null and b/core/assets/cam/arriba1.png differ diff --git a/core/assets/cam/arriba2.png b/core/assets/cam/arriba2.png new file mode 100644 index 0000000..f87df50 Binary files /dev/null and b/core/assets/cam/arriba2.png differ diff --git a/core/assets/cam/arriba3.png b/core/assets/cam/arriba3.png new file mode 100644 index 0000000..0056a2e Binary files /dev/null and b/core/assets/cam/arriba3.png differ diff --git a/core/assets/cam/arriba4.png b/core/assets/cam/arriba4.png new file mode 100644 index 0000000..623a85a Binary files /dev/null and b/core/assets/cam/arriba4.png differ diff --git a/core/assets/cam/fente1.png b/core/assets/cam/fente1.png new file mode 100644 index 0000000..3d9e6c8 Binary files /dev/null and b/core/assets/cam/fente1.png differ diff --git a/core/assets/cam/fente2.png b/core/assets/cam/fente2.png new file mode 100644 index 0000000..ecce2c6 Binary files /dev/null and b/core/assets/cam/fente2.png differ diff --git a/core/assets/cam/fente3.png b/core/assets/cam/fente3.png new file mode 100644 index 0000000..81d67ac Binary files /dev/null and b/core/assets/cam/fente3.png differ diff --git a/core/assets/cam/fente4.png b/core/assets/cam/fente4.png new file mode 100644 index 0000000..92aa2b7 Binary files /dev/null and b/core/assets/cam/fente4.png differ diff --git a/core/assets/cam/fente5.png b/core/assets/cam/fente5.png new file mode 100644 index 0000000..8b372bc Binary files /dev/null and b/core/assets/cam/fente5.png differ diff --git a/core/assets/cam/fente6.png b/core/assets/cam/fente6.png new file mode 100644 index 0000000..c9c464f Binary files /dev/null and b/core/assets/cam/fente6.png differ diff --git a/core/assets/cam/sentado1.png b/core/assets/cam/sentado1.png new file mode 100644 index 0000000..641bf8a Binary files /dev/null and b/core/assets/cam/sentado1.png differ diff --git a/core/assets/cam/sentado2.png b/core/assets/cam/sentado2.png new file mode 100644 index 0000000..b41e198 Binary files /dev/null and b/core/assets/cam/sentado2.png differ diff --git a/core/assets/cam/sentado3.png b/core/assets/cam/sentado3.png new file mode 100644 index 0000000..65dbaf8 Binary files /dev/null and b/core/assets/cam/sentado3.png differ diff --git a/core/assets/cam/stand1.png b/core/assets/cam/stand1.png new file mode 100644 index 0000000..5a16272 Binary files /dev/null and b/core/assets/cam/stand1.png differ diff --git a/core/assets/cam/stand2.png b/core/assets/cam/stand2.png new file mode 100644 index 0000000..0269618 Binary files /dev/null and b/core/assets/cam/stand2.png differ diff --git a/core/assets/cam/stand3.png b/core/assets/cam/stand3.png new file mode 100644 index 0000000..da2a1e0 Binary files /dev/null and b/core/assets/cam/stand3.png differ diff --git a/core/assets/cam/stand4.png b/core/assets/cam/stand4.png new file mode 100644 index 0000000..ce31b58 Binary files /dev/null and b/core/assets/cam/stand4.png differ diff --git a/core/assets/cam/stand5.png b/core/assets/cam/stand5.png new file mode 100644 index 0000000..0d394df Binary files /dev/null and b/core/assets/cam/stand5.png differ diff --git a/core/assets/cam/stand6.png b/core/assets/cam/stand6.png new file mode 100644 index 0000000..bdb2452 Binary files /dev/null and b/core/assets/cam/stand6.png differ diff --git a/core/assets/cam/stand7.png b/core/assets/cam/stand7.png new file mode 100644 index 0000000..396ec8e Binary files /dev/null and b/core/assets/cam/stand7.png differ diff --git a/core/assets/cam/stand8.png b/core/assets/cam/stand8.png new file mode 100644 index 0000000..597bf04 Binary files /dev/null and b/core/assets/cam/stand8.png differ diff --git a/core/assets/ken/arriba1.png b/core/assets/ken/arriba1.png new file mode 100644 index 0000000..ff24500 Binary files /dev/null and b/core/assets/ken/arriba1.png differ diff --git a/core/assets/ken/arriba2.png b/core/assets/ken/arriba2.png new file mode 100644 index 0000000..b635475 Binary files /dev/null and b/core/assets/ken/arriba2.png differ diff --git a/core/assets/ken/arriba3.png b/core/assets/ken/arriba3.png new file mode 100644 index 0000000..4a246f3 Binary files /dev/null and b/core/assets/ken/arriba3.png differ diff --git a/core/assets/ken/frente1.png b/core/assets/ken/frente1.png new file mode 100644 index 0000000..7ca870c Binary files /dev/null and b/core/assets/ken/frente1.png differ diff --git a/core/assets/ken/frente2.png b/core/assets/ken/frente2.png new file mode 100644 index 0000000..4e54f9a Binary files /dev/null and b/core/assets/ken/frente2.png differ diff --git a/core/assets/ken/frente3.png b/core/assets/ken/frente3.png new file mode 100644 index 0000000..cbe1054 Binary files /dev/null and b/core/assets/ken/frente3.png differ diff --git a/core/assets/ken/sentado1.png b/core/assets/ken/sentado1.png new file mode 100644 index 0000000..4ac7dc3 Binary files /dev/null and b/core/assets/ken/sentado1.png differ diff --git a/core/assets/ken/sentado2.png b/core/assets/ken/sentado2.png new file mode 100644 index 0000000..866870f Binary files /dev/null and b/core/assets/ken/sentado2.png differ diff --git a/core/assets/ken/sentado3.png b/core/assets/ken/sentado3.png new file mode 100644 index 0000000..231c840 Binary files /dev/null and b/core/assets/ken/sentado3.png differ diff --git a/core/assets/ken/stand1.png b/core/assets/ken/stand1.png new file mode 100644 index 0000000..a58e79e Binary files /dev/null and b/core/assets/ken/stand1.png differ diff --git a/core/assets/ken/stand2.png b/core/assets/ken/stand2.png new file mode 100644 index 0000000..07179f3 Binary files /dev/null and b/core/assets/ken/stand2.png differ diff --git a/core/assets/ken/stand3.png b/core/assets/ken/stand3.png new file mode 100644 index 0000000..c484648 Binary files /dev/null and b/core/assets/ken/stand3.png differ diff --git a/core/assets/ken/stand4.png b/core/assets/ken/stand4.png new file mode 100644 index 0000000..bc3021e Binary files /dev/null and b/core/assets/ken/stand4.png differ diff --git a/core/assets/ken/stand5.png b/core/assets/ken/stand5.png new file mode 100644 index 0000000..8db0afd Binary files /dev/null and b/core/assets/ken/stand5.png differ diff --git a/core/assets/ken/stand6.png b/core/assets/ken/stand6.png new file mode 100644 index 0000000..6e1bdbb Binary files /dev/null and b/core/assets/ken/stand6.png differ diff --git a/core/assets/ryu/arriba1.png b/core/assets/ryu/arriba1.png new file mode 100644 index 0000000..d538dd4 Binary files /dev/null and b/core/assets/ryu/arriba1.png differ diff --git a/core/assets/ryu/arriba2.png b/core/assets/ryu/arriba2.png new file mode 100644 index 0000000..79e05c3 Binary files /dev/null and b/core/assets/ryu/arriba2.png differ diff --git a/core/assets/ryu/arriba3.png b/core/assets/ryu/arriba3.png new file mode 100644 index 0000000..dd9d408 Binary files /dev/null and b/core/assets/ryu/arriba3.png differ diff --git a/core/assets/ryu/frente1.png b/core/assets/ryu/frente1.png new file mode 100644 index 0000000..dde5ff0 Binary files /dev/null and b/core/assets/ryu/frente1.png differ diff --git a/core/assets/ryu/frente2.png b/core/assets/ryu/frente2.png new file mode 100644 index 0000000..0b70a13 Binary files /dev/null and b/core/assets/ryu/frente2.png differ diff --git a/core/assets/ryu/frente3.png b/core/assets/ryu/frente3.png new file mode 100644 index 0000000..262339a Binary files /dev/null and b/core/assets/ryu/frente3.png differ diff --git a/core/assets/ryu/sentado1.png b/core/assets/ryu/sentado1.png new file mode 100644 index 0000000..a272901 Binary files /dev/null and b/core/assets/ryu/sentado1.png differ diff --git a/core/assets/ryu/sentado2.png b/core/assets/ryu/sentado2.png new file mode 100644 index 0000000..9ff8eaa Binary files /dev/null and b/core/assets/ryu/sentado2.png differ diff --git a/core/assets/ryu/sentado3.png b/core/assets/ryu/sentado3.png new file mode 100644 index 0000000..fb93ab5 Binary files /dev/null and b/core/assets/ryu/sentado3.png differ diff --git a/core/assets/ryu/stand1.png b/core/assets/ryu/stand1.png new file mode 100644 index 0000000..eac25fd Binary files /dev/null and b/core/assets/ryu/stand1.png differ diff --git a/core/assets/ryu/stand2.png b/core/assets/ryu/stand2.png new file mode 100644 index 0000000..c0e597d Binary files /dev/null and b/core/assets/ryu/stand2.png differ diff --git a/core/assets/ryu/stand3.png b/core/assets/ryu/stand3.png new file mode 100644 index 0000000..34679df Binary files /dev/null and b/core/assets/ryu/stand3.png differ diff --git a/core/assets/ryu/stand4.png b/core/assets/ryu/stand4.png new file mode 100644 index 0000000..6741dfd Binary files /dev/null and b/core/assets/ryu/stand4.png differ diff --git a/core/assets/ryu/stand5.png b/core/assets/ryu/stand5.png new file mode 100644 index 0000000..4480f82 Binary files /dev/null and b/core/assets/ryu/stand5.png differ diff --git a/core/assets/ryu/stand6.png b/core/assets/ryu/stand6.png new file mode 100644 index 0000000..ababd3e Binary files /dev/null and b/core/assets/ryu/stand6.png differ diff --git a/core/bin/main/com/mygdx/game/MyGdxGame.class b/core/bin/main/com/mygdx/game/MyGdxGame.class index ce9c979..21e1c12 100644 Binary files a/core/bin/main/com/mygdx/game/MyGdxGame.class and b/core/bin/main/com/mygdx/game/MyGdxGame.class differ diff --git a/core/bin/main/menus/.gitignore b/core/bin/main/menus/.gitignore index 469aa7c..a6422f9 100644 --- a/core/bin/main/menus/.gitignore +++ b/core/bin/main/menus/.gitignore @@ -4,3 +4,6 @@ /Battle.class /MenuSeleccion.class /Caratula.class +/MenuSeleccion2p.class +/Battle2.class +/Fin.class diff --git a/core/bin/main/menus/Menu.class b/core/bin/main/menus/Menu.class index a5b89cf..ebfb804 100644 Binary files a/core/bin/main/menus/Menu.class and b/core/bin/main/menus/Menu.class differ diff --git a/core/bin/main/menus/MenuInicio.class b/core/bin/main/menus/MenuInicio.class index 4949d92..ba40f2d 100644 Binary files a/core/bin/main/menus/MenuInicio.class and b/core/bin/main/menus/MenuInicio.class differ diff --git a/core/bin/main/utilidades/.gitignore b/core/bin/main/utilidades/.gitignore index 07d1f98..b271e70 100644 --- a/core/bin/main/utilidades/.gitignore +++ b/core/bin/main/utilidades/.gitignore @@ -2,3 +2,6 @@ /Personaje.class /Barra.class /Bot.class +/Personaje2.class +/Araque.class +/Ataque.class diff --git a/core/bin/main/utilidades/Gifs.class b/core/bin/main/utilidades/Gifs.class index d2616e6..f25a14b 100644 Binary files a/core/bin/main/utilidades/Gifs.class and b/core/bin/main/utilidades/Gifs.class differ diff --git a/core/src/com/mygdx/game/MyGdxGame.java b/core/src/com/mygdx/game/MyGdxGame.java index 8f6eb3c..5e24aba 100644 --- a/core/src/com/mygdx/game/MyGdxGame.java +++ b/core/src/com/mygdx/game/MyGdxGame.java @@ -7,10 +7,12 @@ import com.badlogic.gdx.graphics.g2d.BitmapFont; import com.badlogic.gdx.graphics.g2d.SpriteBatch; import menus.Battle; +import menus.Fin; import menus.Menu; import menus.MenuInicio; import menus.MenuOpcions; import menus.MenuSeleccion; +import menus.MenuSeleccion2p; import utilidades.Gifs; public class MyGdxGame extends ApplicationAdapter { @@ -21,6 +23,8 @@ public class MyGdxGame extends ApplicationAdapter { float contadorGif = 0; Gifs pinchos; int menuSeleccionado=0; + int aux=menuSeleccionado; + boolean fin=false; @Override public void create () { batch = new SpriteBatch(); @@ -31,6 +35,8 @@ public class MyGdxGame extends ApplicationAdapter { Menu.menus.add(new MenuInicio()); Menu.menus.add(new MenuOpcions()); Menu.menus.add(new MenuSeleccion()); + Menu.menus.add(new MenuSeleccion2p()); + Menu.menus.add(new Fin()); } @Override diff --git a/core/src/menus/Battle.java b/core/src/menus/Battle.java index da39542..6edd124 100644 --- a/core/src/menus/Battle.java +++ b/core/src/menus/Battle.java @@ -15,7 +15,9 @@ public class Battle extends Menu{ Texture suelo; float contador; boolean cambio; + boolean finalRound; public Battle(String np1, String np2) { + this.finalRound=false; this.cambio=true; this.p2=new Bot(np2, true); this.p1=new Personaje(np1, false); @@ -31,6 +33,8 @@ public class Battle extends Menu{ p1.cambiarEstado(p1.MEDIO); }else if(Gdx.input.isKeyPressed(Input.Keys.W)){ p1.cambiarEstado(p1.ALTO); + }else if(Gdx.input.isKeyPressed(Input.Keys.S)){ + p1.cambiarEstado(p1.BAJO); }else{ p1.cambiarEstado(p1.STAND); } @@ -40,27 +44,56 @@ public class Battle extends Menu{ p2.cambiarEstado((int)Math.round(Math.random()*2)); cambio=false; } - if(contador>1) { - contador=0; - cambio=true; + if(finalRound) { + if(contador>2) { + contador=0; + cambio=true; + } + }else { + if(contador>1) { + contador=0; + cambio=true; + } } + }else { p2.cambiarEstado(p2.STAND); } p1.mover(); p2.mover(); p2.recivir(p1.atacar(delta)); - p1.recivir(p2.atacar(delta)); + if(finalRound) { + p1.recivir(p2.atacar(delta).ataqueFinal()); + }else { + p1.recivir(p2.atacar(delta)); + } this.p1.draw(batch, delta); this.p2.draw(batch, delta); + if(p1.muerto()) { + font.draw(batch, "Has perdido", Gdx.graphics.getWidth()/4,Gdx.graphics.getHeight()/2.6f); + }else if(p2.muerto()){ + font.draw(batch, "Has ganado", Gdx.graphics.getWidth()/4,Gdx.graphics.getHeight()/2.6f); + } return darSeleccionado(); } @Override int darSeleccionado() { - if(p1.muerto()||p2.muerto()) { + if(p1.muerto()) { Menu.menus.remove(Menu.BATTLE); - return Menu.INICIAL; + return Menu.FINAL; + }else if(p2.muerto()) { + if(finalRound) { + Menu.menus.remove(Menu.BATTLE); + return Menu.FINAL; + }else { + this.p1=new Personaje(p1.toString(), false); + this.p2=new Bot(p2.toString(),true); + this.p1.setEnemigo(p2.getCaja()); + this.p2.setEnemigo(p1.getCaja()); + finalRound=true; + + } } return Menu.BATTLE; diff --git a/core/src/menus/Battle2.java b/core/src/menus/Battle2.java new file mode 100644 index 0000000..2f5c674 --- /dev/null +++ b/core/src/menus/Battle2.java @@ -0,0 +1,77 @@ +package menus; + +import com.badlogic.gdx.Gdx; +import com.badlogic.gdx.Input; +import com.badlogic.gdx.graphics.Texture; +import com.badlogic.gdx.graphics.g2d.SpriteBatch; + +import utilidades.Personaje; +import utilidades.Personaje2; + +public class Battle2 extends Menu{ + Personaje p1; + Personaje2 p2; + Texture suelo; + + public Battle2(String np1, String np2) { + this.p2=new Personaje2(np2, true); + this.p1=new Personaje(np1, false); + this.p1.setEnemigo(p2.getCaja()); + this.p2.setEnemigo(p1.getCaja()); + suelo = new Texture("sueloChina.png"); + } + + @Override + public int draw(SpriteBatch batch, float delta) { + batch.draw(suelo,0,0); + if (Gdx.input.isKeyPressed(Input.Keys.E)) { + p1.cambiarEstado(Personaje.MEDIO); + }else if(Gdx.input.isKeyPressed(Input.Keys.W)){ + p1.cambiarEstado(Personaje.ALTO); + }else if(Gdx.input.isKeyPressed(Input.Keys.S)){ + p1.cambiarEstado(Personaje.BAJO); + }else{ + p1.cambiarEstado(Personaje.STAND); + } + + if (Gdx.input.isKeyPressed(Input.Keys.O)) { + p2.cambiarEstado(Personaje.MEDIO); + }else if(Gdx.input.isKeyPressed(Input.Keys.I)){ + p2.cambiarEstado(Personaje.ALTO); + }else if(Gdx.input.isKeyPressed(Input.Keys.K)){ + p2.cambiarEstado(Personaje.BAJO); + }else{ + p2.cambiarEstado(Personaje.STAND); + } + + p1.mover(); + p2.mover(); + p2.recivir(p1.atacar(delta)); + p1.recivir(p2.atacar(delta)); + this.p1.draw(batch, delta); + this.p2.draw(batch, delta); + if(p1.muerto()) { + font.draw(batch, "Ha ganado el jugador 2", Gdx.graphics.getWidth()/4,Gdx.graphics.getHeight()/2.6f); + }else if(p2.muerto()){ + font.draw(batch, "Ha ganado el jugador 1", Gdx.graphics.getWidth()/4,Gdx.graphics.getHeight()/2.6f); + } + + return darSeleccionado(); + } + + @Override + int darSeleccionado() { + if(p1.muerto()||p2.muerto()) { + Menu.menus.remove(Menu.BATTLE); + return Menu.FINAL; + } + + return Menu.BATTLE; + } + + public void dispose() { + super.dispose(); + p1.dispose(); + p2.dispose(); + } +} diff --git a/core/src/menus/Fin.java b/core/src/menus/Fin.java new file mode 100644 index 0000000..a85cba7 --- /dev/null +++ b/core/src/menus/Fin.java @@ -0,0 +1,24 @@ +package menus; + +import com.badlogic.gdx.graphics.g2d.SpriteBatch; + +public class Fin extends Menu{ + + @Override + public int draw(SpriteBatch batch, float delta) { + try { + Thread.sleep(5000); + } catch (InterruptedException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + return Menu.INICIAL; + } + + @Override + int darSeleccionado() { + // TODO Auto-generated method stub + return 0; + } + +} diff --git a/core/src/menus/Menu.java b/core/src/menus/Menu.java index 8d1ad61..6254ea5 100644 --- a/core/src/menus/Menu.java +++ b/core/src/menus/Menu.java @@ -21,7 +21,9 @@ public abstract class Menu { static final int INICIAL=0; static final int OPCIONES=1; static final int SELEC=2; - static final int BATTLE=3; + static final int SELEC2=3; + static final int FINAL=4; + static final int BATTLE=5; int local; static int resolution; BitmapFont font; diff --git a/core/src/menus/MenuInicio.java b/core/src/menus/MenuInicio.java index 46dde7c..62f60ce 100644 --- a/core/src/menus/MenuInicio.java +++ b/core/src/menus/MenuInicio.java @@ -6,7 +6,7 @@ import com.badlogic.gdx.graphics.g2d.SpriteBatch; public class MenuInicio extends Menu{ public MenuInicio() { super(); - this.n_opciones=2; + this.n_opciones=3; this.local=Menu.INICIAL; } @Override @@ -19,11 +19,18 @@ public class MenuInicio extends Menu{ break; } case 1:{ + Menu.selector.draw(batch, Gdx.graphics.getWidth()/5, Gdx.graphics.getHeight()/3f); + Menu.selector.draw(batch, Gdx.graphics.getWidth()/5+220, Gdx.graphics.getHeight()/3f); + break; + } + case 2:{ Menu.selector.draw(batch, Gdx.graphics.getWidth()/5-50, Gdx.graphics.getHeight()/5); Menu.selector.draw(batch, Gdx.graphics.getWidth()/5+230, Gdx.graphics.getHeight()/5); + break; } } font.draw(batch, "iniciar", Gdx.graphics.getWidth()/3.75f,Gdx.graphics.getHeight()/2); + font.draw(batch, "iniciar 2Vs2", Gdx.graphics.getWidth()/4,Gdx.graphics.getHeight()/2.6f); font.draw(batch, "configuracion", Gdx.graphics.getWidth()/5,Gdx.graphics.getHeight()/4); return this.cambiarSeleccionado(); } @@ -31,7 +38,8 @@ public class MenuInicio extends Menu{ int darSeleccionado() { switch(this.position) { case 0:return Menu.SELEC; - case 1:return Menu.OPCIONES; + case 1:return Menu.SELEC2; + case 2:return Menu.OPCIONES; default: return -1; } } diff --git a/core/src/menus/MenuSeleccion2p.java b/core/src/menus/MenuSeleccion2p.java new file mode 100644 index 0000000..cdfbb04 --- /dev/null +++ b/core/src/menus/MenuSeleccion2p.java @@ -0,0 +1,83 @@ +package menus; + +import com.badlogic.gdx.Gdx; +import com.badlogic.gdx.Input; +import com.badlogic.gdx.graphics.Color; +import com.badlogic.gdx.graphics.g2d.SpriteBatch; +import com.badlogic.gdx.graphics.glutils.ShapeRenderer.ShapeType; + +public class MenuSeleccion2p extends MenuSeleccion{ + int p1; + public MenuSeleccion2p() { + super(); + this.local=Menu.SELEC2; + this.p1=-1; + } + + @Override + public int draw(SpriteBatch batch, float delta) { + if(p1!=-1) { + batch.end(); + shapeDrawer.begin(ShapeType.Filled); + shapeDrawer.setColor(Color.GRAY); + shapeDrawer.rect(10+p1*280, 430, 190, 180); + shapeDrawer.end(); + batch.begin(); + } + for(int i=0; i=2) { + contadorCombo=0; + this.tempCombo=5; + } + }else { + contadorCombo=0; + } break; case 3: - + if(estado==Personaje.MEDIO) { + if(contadorCombo<2) { + contadorCombo++; + } + }else if(estado==Personaje.BAJO) { + if(contadorCombo>=2) { + contadorCombo=0; + this.tempCombo=5; + } + }else { + contadorCombo=0; + } break; default: break; @@ -119,28 +154,18 @@ public class Personaje { this.tempCombo=10; } - public void recivir(float danio) { + public void recivir(Ataque ataque) { if(this.caja.overlaps(enemigo)) { - this.vida-=danio; + this.vida-=ataque.danio(this.estado)/this.coeficienteDef; } } - public float atacar(float delta) { - if(this.actual==this.medio) { - if(tempCombo>0) { - return delta*20; - }else { - return delta*10; - } + public Ataque atacar(float delta) { + if(tempCombo>0) { + return new Ataque(this.estado, this.coeficienteDanio*delta*20); + }else { + return new Ataque(this.estado, this.coeficienteDanio*delta*10); } - if(this.actual==this.alto) { - if(tempCombo>0) { - return delta*30; - }else { - return delta*15; - } - } - return 0; } public void mover() { @@ -163,7 +188,12 @@ public class Personaje { } } } - this.caja.setPosition(x, y); + if(this.position) { + this.caja.setPosition(x, y+120); + }else { + this.caja.setPosition(x, y); + } + } public void draw(SpriteBatch batch, float delta) { @@ -177,19 +207,19 @@ public class Personaje { } shapeDrawer.end(); batch.begin(); - this.actual.avanzar(5, delta); - this.actual.draw(batch, this.y, this.x); + this.actual.avanzar(7, delta); + if(this.position) { + this.actual.draw(batch, this.y, this.x); + }else { + this.actual.draw(batch, this.y, this.x); + } batch.end(); if(tempCombo>0) { Gdx.gl.glEnable(GL20.GL_BLEND); Gdx.gl.glBlendFunc(GL20.GL_SRC_ALPHA, GL20.GL_ONE_MINUS_SRC_ALPHA); shapeDrawer.begin(ShapeType.Filled); shapeDrawer.setColor(1f,0f,0f,0.3f); - if(this.position) { - shapeDrawer.circle(y+100, x+80, 80); - }else { - shapeDrawer.circle(y+50, x+80, 80); - } + shapeDrawer.circle(70+(1.35f*y), x+80, 80); shapeDrawer.end(); Gdx.gl.glDisable(GL20.GL_BLEND); tempCombo-=delta; @@ -203,21 +233,33 @@ public class Personaje { } private void ryu(boolean position) { - this.standby=new Gifs("p1.png", 5, 0, 74, 120, 70, 100, position); + /*this.standby=new Gifs("p1.png", 5, 0, 74, 120, 70, 100, position); this.medio=new Gifs("p1.png", 3, 4, 93, 355, 88, 100, position); - this.alto=new Gifs("p1.png", 3, 8, 74, 779, 75, 130, position); + this.alto=new Gifs("p1.png", 3, 8, 74, 779, 75, 130, position);*/ + this.standby=new Gifs("ryu/stand", 6, position); + this.medio=new Gifs("ryu/frente", 3, position); + this.alto=new Gifs("ryu/arriba", 3, position); + this.bajo=new Gifs("ryu/sentado",3,position); } private void ken(boolean position) { - this.standby=new Gifs("p2.png", 5, 0, 70, 863, 67, 93, position); + /*this.standby=new Gifs("p2.png", 5, 0, 70, 863, 67, 93, position); this.medio=new Gifs("p2.png", 2, 0, 70, 1145, 72, 100, position); - this.alto=new Gifs("p2.png", 3, 6, 74, 2920, 75, 130, position); + this.alto=new Gifs("p2.png", 3, 6, 74, 2920, 75, 130, position);*/ + this.standby=new Gifs("ken/stand", 6, position); + this.medio=new Gifs("ken/frente", 3, position); + this.alto=new Gifs("ken/arriba", 3, position); + this.bajo=new Gifs("ken/sentado",3,position); } private void cam(boolean position) { - this.standby=new Gifs("p3.png", 8, 0, 78, 113, 75, 98, position); + /*this.standby=new Gifs("p3.png", 8, 0, 78, 113, 75, 98, position); this.medio=new Gifs("p3.png", 2, 77, 86, 613, 90, 100, position); - this.alto=new Gifs("p3.png", 2, 192, 68, 1327, 60, 100, position); + this.alto=new Gifs("p3.png", 2, 192, 68, 1327, 60, 100, position);*/ + this.standby=new Gifs("cam/stand", 8, position); + this.medio=new Gifs("cam/fente", 6, position); + this.alto=new Gifs("cam/arriba", 4, position); + this.bajo=new Gifs("cam/sentado",3,position); } public Rectangle getCaja() { @@ -231,4 +273,13 @@ public class Personaje { public boolean muerto() { return this.vida<0; } + + public String toString() { + switch (caracter) { + case 1:return "ryu"; + case 2:return "ken"; + case 3:return "cam"; + } + return ""; + } } diff --git a/core/src/utilidades/Personaje2.java b/core/src/utilidades/Personaje2.java new file mode 100644 index 0000000..22fed02 --- /dev/null +++ b/core/src/utilidades/Personaje2.java @@ -0,0 +1,12 @@ +package utilidades; + +import com.badlogic.gdx.Input; + +public class Personaje2 extends Personaje{ + + public Personaje2(String caracter, boolean position) { + super(caracter, position); + this.keyL=Input.Keys.J; + this.keyR=Input.Keys.L; + } +} diff --git a/desktop/bin/main/.gitignore b/desktop/bin/main/.gitignore index 66d69da..77a2ba2 100644 --- a/desktop/bin/main/.gitignore +++ b/desktop/bin/main/.gitignore @@ -3,3 +3,6 @@ /p2.png /sueloChina.png /p3.png +/ryu/ +/cam/ +/ken/