inicio personajes y partida
This commit is contained in:
40
core/src/menus/Battle.java
Normal file
40
core/src/menus/Battle.java
Normal file
@@ -0,0 +1,40 @@
|
||||
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;
|
||||
|
||||
public class Battle extends Menu{
|
||||
|
||||
Personaje p1;
|
||||
Personaje p2;
|
||||
Texture suelo;
|
||||
public Battle() {
|
||||
this.p2=new Personaje("ken", true);
|
||||
this.p1=new Personaje("ryu", false);
|
||||
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(p1.MEDIO);
|
||||
}else {
|
||||
p1.cambiarEstado(p1.STAND);
|
||||
}
|
||||
this.p1.draw(batch, delta, 150, 10);
|
||||
this.p2.draw(batch, delta, 250, 10);
|
||||
return Menu.BATTLE;
|
||||
}
|
||||
|
||||
@Override
|
||||
int darSeleccionado() {
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -20,6 +20,7 @@ public abstract class Menu {
|
||||
static final int FHD=2;
|
||||
static final int INICIAL=0;
|
||||
static final int OPCIONES=1;
|
||||
static final int BATTLE=2;
|
||||
int local;
|
||||
static int resolution;
|
||||
BitmapFont font;
|
||||
@@ -29,13 +30,14 @@ public abstract class Menu {
|
||||
this.position=0;
|
||||
this.pres=true;
|
||||
font = new BitmapFont(Gdx.files.internal("CentieSans.fnt"));
|
||||
selector = new Gifs("125760.png", 14, 39, 49, 15, 40, 40);
|
||||
selector = new Gifs("iconos.png", 14, 39, 49, 15, 40, 40, false);
|
||||
}
|
||||
|
||||
abstract public int draw(SpriteBatch batch, float delta);
|
||||
|
||||
void dispose() {
|
||||
public void dispose() {
|
||||
font.dispose();
|
||||
selector.dispose();
|
||||
}
|
||||
|
||||
int cambiarSeleccionado() {
|
||||
|
||||
@@ -30,7 +30,7 @@ public class MenuInicio extends Menu{
|
||||
|
||||
int darSeleccionado() {
|
||||
switch(this.position) {
|
||||
case 0:return 2;
|
||||
case 0:return Menu.BATTLE;
|
||||
case 1:return Menu.OPCIONES;
|
||||
default: return -1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user