Borrado de archivos innecesarios
This commit is contained in:
@@ -1,21 +0,0 @@
|
||||
package otros.arkanoid;
|
||||
|
||||
import capitulo04.utils.Utils;
|
||||
|
||||
public class Juego {
|
||||
public static void main(String[] args) {
|
||||
Ladrillo[] ladrillos = new Ladrillo[20];
|
||||
Pelota pelota = new Pelota();
|
||||
|
||||
for (int i = 0; i < ladrillos.length; i++) {
|
||||
ladrillos[i] = new Ladrillo();
|
||||
}
|
||||
|
||||
while (true) {
|
||||
pelota.setX(Utils.generarIntAleatorioEntreLimites(0,800));
|
||||
pelota.setY(Utils.generarIntAleatorioEntreLimites(0,800));
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,103 +0,0 @@
|
||||
package otros.arkanoid;
|
||||
|
||||
import capitulo04.utils.Utils;
|
||||
|
||||
public class Ladrillo {
|
||||
private String color;
|
||||
private int x;
|
||||
private int y;
|
||||
private int ancho;
|
||||
private int alto;
|
||||
private int puntosVida;
|
||||
|
||||
public Ladrillo() {
|
||||
this.x = Utils.generarIntAleatorioEntreLimites(0, 800);
|
||||
this.y = Utils.generarIntAleatorioEntreLimites(0, 500);
|
||||
this.ancho = 100;
|
||||
this.alto = 50;
|
||||
this.puntosVida = Utils.generarIntAleatorioEntreLimites(1, 3);
|
||||
|
||||
String[] colores = new String[]{"rojo", "verde", "azul"};
|
||||
if (puntosVida == 1) {
|
||||
int colorEscogido = Utils.generarIntAleatorioEntreLimites(0, 2);
|
||||
this.color = colores[colorEscogido];
|
||||
} else if (puntosVida == 2) {
|
||||
this.color = "plateado";
|
||||
} else {
|
||||
this.color = "dorado";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param p Pelota
|
||||
* @return Devuelve si tiene vida o se ha quedado a 0
|
||||
*/
|
||||
public boolean pelotaChocaEnLadrillo(Pelota p) {
|
||||
if (p.getX() > this.x
|
||||
&& p.getY() > this.y) {
|
||||
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
public String getColor() {
|
||||
return color;
|
||||
}
|
||||
|
||||
public void setColor(String color) {
|
||||
this.color = color;
|
||||
}
|
||||
|
||||
public int getX() {
|
||||
return x;
|
||||
}
|
||||
|
||||
public void setX(int x) {
|
||||
this.x = x;
|
||||
}
|
||||
|
||||
public int getY() {
|
||||
return y;
|
||||
}
|
||||
|
||||
public void setY(int y) {
|
||||
this.y = y;
|
||||
}
|
||||
|
||||
public int getAncho() {
|
||||
return ancho;
|
||||
}
|
||||
|
||||
public void setAncho(int ancho) {
|
||||
this.ancho = ancho;
|
||||
}
|
||||
|
||||
public int getAlto() {
|
||||
return alto;
|
||||
}
|
||||
|
||||
public void setAlto(int alto) {
|
||||
this.alto = alto;
|
||||
}
|
||||
|
||||
public int getPuntosVida() {
|
||||
return puntosVida;
|
||||
}
|
||||
|
||||
public void setPuntosVida(int puntosVida) {
|
||||
this.puntosVida = puntosVida;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Ladrillo{" +
|
||||
"color='" + color + '\'' +
|
||||
", x=" + x +
|
||||
", y=" + y +
|
||||
", ancho=" + ancho +
|
||||
", alto=" + alto +
|
||||
", puntosVida=" + puntosVida +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
package otros.arkanoid;
|
||||
|
||||
public class Pelota {
|
||||
private int x;
|
||||
private int y;
|
||||
|
||||
public Pelota() {
|
||||
}
|
||||
|
||||
public int getX() {
|
||||
return x;
|
||||
}
|
||||
|
||||
public void setX(int x) {
|
||||
this.x = x;
|
||||
}
|
||||
|
||||
public int getY() {
|
||||
return y;
|
||||
}
|
||||
|
||||
public void setY(int y) {
|
||||
this.y = y;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Pelota{" +
|
||||
"x=" + x +
|
||||
", y=" + y +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -1,49 +0,0 @@
|
||||
package otros.cromos;
|
||||
|
||||
public class Cromo {
|
||||
private String nombreJugador;
|
||||
private int puntuacion;
|
||||
private String equipo;
|
||||
|
||||
public Cromo() {
|
||||
}
|
||||
|
||||
public Cromo(String nombreJugador, int puntuacion, String equipo) {
|
||||
this.nombreJugador = nombreJugador;
|
||||
this.puntuacion = puntuacion;
|
||||
this.equipo = equipo;
|
||||
}
|
||||
|
||||
public String getNombreJugador() {
|
||||
return nombreJugador;
|
||||
}
|
||||
|
||||
public void setNombreJugador(String nombreJugador) {
|
||||
this.nombreJugador = nombreJugador;
|
||||
}
|
||||
|
||||
private int getPuntuacion() {
|
||||
return puntuacion;
|
||||
}
|
||||
|
||||
public void setPuntuacion(int puntuacion) {
|
||||
this.puntuacion = puntuacion;
|
||||
}
|
||||
|
||||
public String getEquipo() {
|
||||
return equipo;
|
||||
}
|
||||
|
||||
public void setEquipo(String equipo) {
|
||||
this.equipo = equipo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Cromo{" +
|
||||
"nombre='" + nombreJugador + '\'' +
|
||||
", puntuacion=" + puntuacion +
|
||||
", equipo='" + equipo + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
package otros.cromos;
|
||||
|
||||
public class CromoBaloncesto extends Cromo{
|
||||
private int altura;
|
||||
|
||||
public CromoBaloncesto() {
|
||||
}
|
||||
|
||||
public CromoBaloncesto(String nombreJugador, int puntuacion, String equipo) {
|
||||
super(nombreJugador, puntuacion, equipo);
|
||||
}
|
||||
|
||||
public CromoBaloncesto(String nombreJugador, int puntuacion, String equipo, int altura) {
|
||||
super(nombreJugador, puntuacion, equipo);
|
||||
this.altura = altura;
|
||||
}
|
||||
|
||||
public int getAltura() {
|
||||
return altura;
|
||||
}
|
||||
|
||||
public void setAltura(int altura) {
|
||||
this.altura = altura;
|
||||
}
|
||||
|
||||
public void prueba() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
package otros.cromos;
|
||||
|
||||
public class CromoFutbol extends Cromo{
|
||||
public CromoFutbol() {
|
||||
}
|
||||
|
||||
public CromoFutbol(String nombreJugador, int puntuacion, String equipo) {
|
||||
super(nombreJugador, puntuacion, equipo);
|
||||
}
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
package otros.cromos;
|
||||
|
||||
public class Principal {
|
||||
public static void main(String[] args) {
|
||||
CromoBaloncesto pepe = new CromoBaloncesto("Hola", 70, "pepe");
|
||||
//System.out.println(pepe/*.getPuntuacion()*/);
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user