Nuevos sprites mejorados, valanceo de ataques y combos
							
								
								
									
										
											BIN
										
									
								
								core/assets/cam/arriba1.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 108 KiB | 
							
								
								
									
										
											BIN
										
									
								
								core/assets/cam/arriba2.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 108 KiB | 
							
								
								
									
										
											BIN
										
									
								
								core/assets/cam/arriba3.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 108 KiB | 
							
								
								
									
										
											BIN
										
									
								
								core/assets/cam/arriba4.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 108 KiB | 
							
								
								
									
										
											BIN
										
									
								
								core/assets/cam/fente1.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 108 KiB | 
							
								
								
									
										
											BIN
										
									
								
								core/assets/cam/fente2.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 108 KiB | 
							
								
								
									
										
											BIN
										
									
								
								core/assets/cam/fente3.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 108 KiB | 
							
								
								
									
										
											BIN
										
									
								
								core/assets/cam/fente4.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 108 KiB | 
							
								
								
									
										
											BIN
										
									
								
								core/assets/cam/fente5.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 108 KiB | 
							
								
								
									
										
											BIN
										
									
								
								core/assets/cam/fente6.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 108 KiB | 
							
								
								
									
										
											BIN
										
									
								
								core/assets/cam/sentado1.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 108 KiB | 
							
								
								
									
										
											BIN
										
									
								
								core/assets/cam/sentado2.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 108 KiB | 
							
								
								
									
										
											BIN
										
									
								
								core/assets/cam/sentado3.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 108 KiB | 
							
								
								
									
										
											BIN
										
									
								
								core/assets/cam/stand1.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 108 KiB | 
							
								
								
									
										
											BIN
										
									
								
								core/assets/cam/stand2.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 108 KiB | 
							
								
								
									
										
											BIN
										
									
								
								core/assets/cam/stand3.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 108 KiB | 
							
								
								
									
										
											BIN
										
									
								
								core/assets/cam/stand4.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 108 KiB | 
							
								
								
									
										
											BIN
										
									
								
								core/assets/cam/stand5.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 108 KiB | 
							
								
								
									
										
											BIN
										
									
								
								core/assets/cam/stand6.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 108 KiB | 
							
								
								
									
										
											BIN
										
									
								
								core/assets/cam/stand7.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 108 KiB | 
							
								
								
									
										
											BIN
										
									
								
								core/assets/cam/stand8.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 108 KiB | 
							
								
								
									
										
											BIN
										
									
								
								core/assets/ken/arriba1.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 108 KiB | 
							
								
								
									
										
											BIN
										
									
								
								core/assets/ken/arriba2.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 108 KiB | 
							
								
								
									
										
											BIN
										
									
								
								core/assets/ken/arriba3.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 108 KiB | 
							
								
								
									
										
											BIN
										
									
								
								core/assets/ken/frente1.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 108 KiB | 
							
								
								
									
										
											BIN
										
									
								
								core/assets/ken/frente2.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 108 KiB | 
							
								
								
									
										
											BIN
										
									
								
								core/assets/ken/frente3.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 108 KiB | 
							
								
								
									
										
											BIN
										
									
								
								core/assets/ken/sentado1.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 108 KiB | 
							
								
								
									
										
											BIN
										
									
								
								core/assets/ken/sentado2.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 108 KiB | 
							
								
								
									
										
											BIN
										
									
								
								core/assets/ken/sentado3.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 108 KiB | 
							
								
								
									
										
											BIN
										
									
								
								core/assets/ken/stand1.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 108 KiB | 
							
								
								
									
										
											BIN
										
									
								
								core/assets/ken/stand2.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 108 KiB | 
							
								
								
									
										
											BIN
										
									
								
								core/assets/ken/stand3.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 108 KiB | 
							
								
								
									
										
											BIN
										
									
								
								core/assets/ken/stand4.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 108 KiB | 
							
								
								
									
										
											BIN
										
									
								
								core/assets/ken/stand5.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 108 KiB | 
							
								
								
									
										
											BIN
										
									
								
								core/assets/ken/stand6.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 108 KiB | 
							
								
								
									
										
											BIN
										
									
								
								core/assets/ryu/arriba1.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 108 KiB | 
							
								
								
									
										
											BIN
										
									
								
								core/assets/ryu/arriba2.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 108 KiB | 
							
								
								
									
										
											BIN
										
									
								
								core/assets/ryu/arriba3.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 108 KiB | 
							
								
								
									
										
											BIN
										
									
								
								core/assets/ryu/frente1.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 108 KiB | 
							
								
								
									
										
											BIN
										
									
								
								core/assets/ryu/frente2.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 108 KiB | 
							
								
								
									
										
											BIN
										
									
								
								core/assets/ryu/frente3.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 108 KiB | 
							
								
								
									
										
											BIN
										
									
								
								core/assets/ryu/sentado1.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 108 KiB | 
							
								
								
									
										
											BIN
										
									
								
								core/assets/ryu/sentado2.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 108 KiB | 
							
								
								
									
										
											BIN
										
									
								
								core/assets/ryu/sentado3.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 108 KiB | 
							
								
								
									
										
											BIN
										
									
								
								core/assets/ryu/stand1.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 108 KiB | 
							
								
								
									
										
											BIN
										
									
								
								core/assets/ryu/stand2.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 108 KiB | 
							
								
								
									
										
											BIN
										
									
								
								core/assets/ryu/stand3.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 108 KiB | 
							
								
								
									
										
											BIN
										
									
								
								core/assets/ryu/stand4.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 108 KiB | 
							
								
								
									
										
											BIN
										
									
								
								core/assets/ryu/stand5.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 108 KiB | 
							
								
								
									
										
											BIN
										
									
								
								core/assets/ryu/stand6.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 108 KiB | 
							
								
								
									
										3
									
								
								core/bin/main/menus/.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						| @ -4,3 +4,6 @@ | ||||
| /Battle.class | ||||
| /MenuSeleccion.class | ||||
| /Caratula.class | ||||
| /MenuSeleccion2p.class | ||||
| /Battle2.class | ||||
| /Fin.class | ||||
|  | ||||
							
								
								
									
										3
									
								
								core/bin/main/utilidades/.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						| @ -2,3 +2,6 @@ | ||||
| /Personaje.class | ||||
| /Barra.class | ||||
| /Bot.class | ||||
| /Personaje2.class | ||||
| /Araque.class | ||||
| /Ataque.class | ||||
|  | ||||
| @ -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 | ||||
|  | ||||
| @ -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(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)); | ||||
| 		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; | ||||
|  | ||||
							
								
								
									
										77
									
								
								core/src/menus/Battle2.java
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @ -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(); | ||||
| 	} | ||||
| } | ||||
							
								
								
									
										24
									
								
								core/src/menus/Fin.java
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @ -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; | ||||
| 	} | ||||
| 	 | ||||
| } | ||||
| @ -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; | ||||
|  | ||||
| @ -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; | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
							
								
								
									
										83
									
								
								core/src/menus/MenuSeleccion2p.java
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @ -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<this.caratulas.size();i++) { | ||||
| 			if(i<3) { | ||||
| 				if(i==this.position) { | ||||
| 					batch.end(); | ||||
| 					shapeDrawer.begin(ShapeType.Filled); | ||||
| 					if(p1!=-1) { | ||||
| 						shapeDrawer.setColor(Color.BLACK); | ||||
| 					}else { | ||||
| 						shapeDrawer.setColor(Color.GRAY); | ||||
| 					} | ||||
| 					shapeDrawer.rect(10+i*280, 430, 190, 180); | ||||
| 					shapeDrawer.end(); | ||||
| 					batch.begin(); | ||||
| 				} | ||||
| 				this.caratulas.get(i).draw(batch, 10+i*200, 300); | ||||
| 			}else { | ||||
| 				this.caratulas.get(i).draw(batch, 10+(i-2)*200, 150); | ||||
| 			} | ||||
| 			 | ||||
| 		} | ||||
| 		return this.darSeleccionado(); | ||||
| 	} | ||||
| 	 | ||||
| 	@Override | ||||
| 	int darSeleccionado() { | ||||
| 		if (Gdx.input.isKeyPressed(Input.Keys.RIGHT)) { | ||||
| 			if(!this.pres) { | ||||
| 				this.position++; | ||||
| 				this.pres=true; | ||||
| 			} | ||||
| 		}else if (Gdx.input.isKeyPressed(Input.Keys.LEFT)) { | ||||
| 			if(!this.pres) { | ||||
| 				this.position--; | ||||
| 				this.pres=true; | ||||
| 			} | ||||
| 		}else if (Gdx.input.isKeyPressed(Input.Keys.ENTER)){ | ||||
| 			if(!this.pres) { | ||||
| 				this.pres=true; | ||||
| 				if(p1==-1) { | ||||
| 					p1=this.position; | ||||
| 					this.position=0; | ||||
| 				}else { | ||||
| 					Menu.menus.add(new Battle2(this.caratulas.get(this.p1).nombre, | ||||
| 							this.caratulas.get(this.position).nombre)); | ||||
| 					this.p1=-1; | ||||
| 					this.position=0; | ||||
| 					return Menu.BATTLE; | ||||
| 				} | ||||
| 			} | ||||
| 		}else if(this.pres) { | ||||
| 			this.pres=false; | ||||
| 		} | ||||
| 		this.position%=this.n_opciones; | ||||
| 		if(this.position<0)this.position=this.n_opciones-1; | ||||
| 		return this.local; | ||||
| 	} | ||||
| } | ||||
							
								
								
									
										42
									
								
								core/src/utilidades/Ataque.java
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @ -0,0 +1,42 @@ | ||||
| package utilidades; | ||||
| 
 | ||||
| public class Ataque { | ||||
| 	int tipo; | ||||
| 	float valor; | ||||
| 	public Ataque(int tipo, float valor) { | ||||
| 		this.tipo=tipo; | ||||
| 		this.valor=valor; | ||||
| 	} | ||||
| 	 | ||||
| 	public Ataque ataqueFinal() { | ||||
| 		this.valor*=2; | ||||
| 		return this; | ||||
| 	} | ||||
| 	 | ||||
| 	float danio(int tipo) { | ||||
| 		switch(this.tipo) { | ||||
| 		case Personaje.ALTO: | ||||
| 			if(tipo==Personaje.BAJO) { | ||||
| 				return 0; | ||||
| 			}else { | ||||
| 				return valor*2; | ||||
| 			} | ||||
| 		case Personaje.MEDIO: | ||||
| 			if(tipo==Personaje.ALTO) { | ||||
| 				return valor*1.2f; | ||||
| 			}else if(tipo==Personaje.BAJO) { | ||||
| 				return valor*0.8f; | ||||
| 			} | ||||
| 			break; | ||||
| 		case Personaje.BAJO:{ | ||||
| 			if(tipo==Personaje.BAJO) { | ||||
| 				return valor*1; | ||||
| 			}else { | ||||
| 				return valor*0.5f; | ||||
| 
 | ||||
| 			} | ||||
| 		} | ||||
| 		} | ||||
| 		return 0; | ||||
| 	} | ||||
| } | ||||
| @ -1,8 +1,5 @@ | ||||
| package utilidades; | ||||
| 
 | ||||
| import com.badlogic.gdx.Gdx; | ||||
| import com.badlogic.gdx.graphics.g2d.SpriteBatch; | ||||
| 
 | ||||
| public class Bot extends Personaje{ | ||||
| 
 | ||||
| 	public Bot(String caracter, boolean position) { | ||||
| @ -29,7 +26,12 @@ public class Bot extends Personaje{ | ||||
| 				} | ||||
| 			} | ||||
| 		} | ||||
| 		if(position) { | ||||
| 			this.caja.setPosition(x, y+120); | ||||
| 		}else { | ||||
| 			this.caja.setPosition(x, y); | ||||
| 		} | ||||
| 		 | ||||
| 	} | ||||
| 
 | ||||
| } | ||||
|  | ||||
| @ -22,14 +22,12 @@ public class Gifs { | ||||
| 		} | ||||
| 	} | ||||
| 	 | ||||
| 	public Gifs(Texture textura, int n_estados, int inicio_image, int desplazamiento,  | ||||
| 			int anchura, int x, int y) { | ||||
| 		this.textura = textura; | ||||
| 		this.n_estados = n_estados; | ||||
| 	public Gifs(String nombre, int n_estados, boolean flip) { | ||||
| 		this.n_estados=n_estados; | ||||
| 		frames = new TextureRegion[n_estados]; | ||||
| 		for(int i = 0; i<n_estados; i++) { | ||||
| 			frames[i] = new TextureRegion(textura, inicio_image+i*desplazamiento | ||||
| 					, anchura, x, y); | ||||
| 			frames[i] = new TextureRegion(new Texture(nombre+(i+1)+".png")); | ||||
| 			frames[i].flip(flip, false); | ||||
| 		} | ||||
| 	} | ||||
| 	public void avanzar(int speed, float delta) { | ||||
|  | ||||
| @ -19,8 +19,9 @@ public class Personaje { | ||||
| 	public static final int ALTO=1; | ||||
| 	public static final int MEDIO=2; | ||||
| 	public static final int BAJO=3; | ||||
| 	private int keyR; | ||||
| 	private int keyL; | ||||
| 	int estado; | ||||
| 	int keyR; | ||||
| 	int keyL; | ||||
| 	int x; | ||||
| 	int y; | ||||
| 	float contadorCombo; | ||||
| @ -32,35 +33,46 @@ public class Personaje { | ||||
| 	ShapeRenderer shapeDrawer; | ||||
| 	String combo; | ||||
| 	int caracter; | ||||
| 	float coeficienteDanio; | ||||
| 	float coeficienteDef; | ||||
| 	public Personaje(String caracter, boolean position) { | ||||
| 		this.tempCombo=0; | ||||
| 		this.combo=""; | ||||
| 		shapeDrawer=new ShapeRenderer(); | ||||
| 		//PolygonShape shape = new PolygonShape(1); | ||||
| 		this.vida=100; | ||||
| 		this.position=position; | ||||
| 		if(position) { | ||||
| 			this.x=10; | ||||
| 			this.y=250; | ||||
| 			this.y=370; | ||||
| 		}else { | ||||
| 			this.x=10; | ||||
| 			this.y=150; | ||||
| 		} | ||||
| 		if(this.position) { | ||||
| 			this.caja=new Rectangle(x, y+120,70,70); | ||||
| 		}else { | ||||
| 			this.caja=new Rectangle(x, y,70,70); | ||||
| 		} | ||||
| 		this.keyR=Input.Keys.D; | ||||
| 		this.keyL=Input.Keys.A; | ||||
| 		switch (caracter) { | ||||
| 		case "ryu": | ||||
| 			this.caracter=1; | ||||
| 			this.ryu(position); | ||||
| 			this.coeficienteDanio=1; | ||||
| 			this.coeficienteDef=1; | ||||
| 			break; | ||||
| 		case "ken": | ||||
| 			this.caracter=2; | ||||
| 			this.ken(position); | ||||
| 			this.coeficienteDanio=0.8f; | ||||
| 			this.coeficienteDef=1.2f; | ||||
| 			break; | ||||
| 		case "cam": | ||||
| 			this.caracter=3; | ||||
| 			this.cam(position); | ||||
| 			this.coeficienteDanio=1.2f; | ||||
| 			this.coeficienteDef=0.8f; | ||||
| 		default: | ||||
| 			break; | ||||
| 		} | ||||
| @ -68,6 +80,7 @@ public class Personaje { | ||||
| 	} | ||||
| 	 | ||||
| 	public void cambiarEstado(int estado) { | ||||
| 		this.estado=estado; | ||||
| 		this.boost(estado); | ||||
| 		switch(estado) { | ||||
| 		case STAND: | ||||
| @ -105,10 +118,32 @@ public class Personaje { | ||||
| 			} | ||||
| 			break; | ||||
| 		case 2: | ||||
| 			 | ||||
| 			if(estado==Personaje.BAJO) { | ||||
| 				if(contadorCombo<2) { | ||||
| 					contadorCombo++; | ||||
| 				} | ||||
| 			}else if(estado==Personaje.ALTO) { | ||||
| 				if(contadorCombo>=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,29 +154,19 @@ 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) { | ||||
| 	public Ataque atacar(float delta) { | ||||
| 		if(tempCombo>0) { | ||||
| 				return delta*20; | ||||
| 			return new Ataque(this.estado, this.coeficienteDanio*delta*20); | ||||
| 		}else { | ||||
| 				return delta*10; | ||||
| 			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,9 +188,14 @@ public class Personaje { | ||||
| 				} | ||||
| 			} | ||||
| 		} | ||||
| 		if(this.position) { | ||||
| 			this.caja.setPosition(x, y+120); | ||||
| 		}else { | ||||
| 			this.caja.setPosition(x, y); | ||||
| 		} | ||||
| 		 | ||||
| 	} | ||||
| 	 | ||||
| 	public void draw(SpriteBatch batch, float delta) { | ||||
| 		batch.end(); | ||||
| 		shapeDrawer.begin(ShapeType.Filled); | ||||
| @ -177,19 +207,19 @@ public class Personaje { | ||||
| 		} | ||||
| 		shapeDrawer.end(); | ||||
| 		batch.begin(); | ||||
| 		this.actual.avanzar(5, delta); | ||||
| 		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 ""; | ||||
| 	} | ||||
| } | ||||
|  | ||||
							
								
								
									
										12
									
								
								core/src/utilidades/Personaje2.java
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @ -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; | ||||
| 	} | ||||
| } | ||||
							
								
								
									
										3
									
								
								desktop/bin/main/.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						| @ -3,3 +3,6 @@ | ||||
| /p2.png | ||||
| /sueloChina.png | ||||
| /p3.png | ||||
| /ryu/ | ||||
| /cam/ | ||||
| /ken/ | ||||
|  | ||||