Skip to content

Commit 5aedcd3

Browse files
committed
Documentadas algunas clases
1 parent af3a289 commit 5aedcd3

File tree

7 files changed

+65
-2
lines changed

7 files changed

+65
-2
lines changed

arkanoidx/src/org/sfsoft/arkanoidx/characters/Ball.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,15 @@
22

33
import com.badlogic.gdx.graphics.Texture;
44

5+
/**
6+
* Clase que representa la bola
7+
* @author Santiago Faci
8+
* @version 1.0
9+
*
10+
*/
511
public class Ball extends Character {
612

13+
// Al comenzar la partida la bola puede aparecer pausada
714
boolean paused;
815

916
public Ball(Texture texture, float x, float y) {
@@ -16,7 +23,5 @@ public void update(float dt) {
1623

1724
if (paused)
1825
return;
19-
20-
2126
}
2227
}

arkanoidx/src/org/sfsoft/arkanoidx/characters/Board.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@
44

55
import com.badlogic.gdx.graphics.Texture;
66

7+
/**
8+
* Clase que representa la tabla del jugador
9+
* @author Santiago Faci
10+
* @version 1.0
11+
*
12+
*/
713
public class Board extends Character {
814

915
int lives;
@@ -13,6 +19,7 @@ public Board(Texture texture, float x, float y, int lives) {
1319
this.lives = lives;
1420
}
1521

22+
// Desplaza la tabla en el eje x
1623
public void move(float x) {
1724

1825
this.x += x;
@@ -21,6 +28,7 @@ public void move(float x) {
2128
@Override
2229
public void update(float dt) {
2330

31+
// Comprueba los límites de la pantalla
2432
if (x <= 0)
2533
x = 0;
2634

arkanoidx/src/org/sfsoft/arkanoidx/characters/Brick.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,15 @@
22

33
import com.badlogic.gdx.graphics.Texture;
44

5+
/**
6+
* Clase que representa a cada uno de los ladrillos del juego
7+
* @author Santiago Faci
8+
* @version
9+
*
10+
*/
511
public class Brick extends Character {
612

13+
// Tipo de ladrillo
714
public enum BrickType {
815
YELLOW, BLACK, GREEN, WHITE, PURPLE, RED, BLUE, GRAY
916
}

arkanoidx/src/org/sfsoft/arkanoidx/characters/Character.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@
33
import com.badlogic.gdx.graphics.Texture;
44
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
55

6+
/**
7+
* Clase base para todos los caracteres del juego
8+
* @author Santiago Faci
9+
* @version 1.0
10+
*
11+
*/
612
public abstract class Character {
713

814
Texture texture;

arkanoidx/src/org/sfsoft/arkanoidx/managers/LevelManager.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
package org.sfsoft.arkanoidx.managers;
22

3+
/**
4+
* Clase que gestiona los niveles del juego
5+
* @author Santiago Faci
6+
*
7+
*/
38
public class LevelManager {
49

510
public int currentLevel;
@@ -9,6 +14,9 @@ public LevelManager() {
914
currentLevel = 1;
1015
}
1116

17+
/**
18+
* Carga el nivel actual
19+
*/
1220
public void loadCurrentLevel() {
1321

1422

arkanoidx/src/org/sfsoft/arkanoidx/managers/ResourceManager.java

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,19 @@
66
import com.badlogic.gdx.audio.Sound;
77
import com.badlogic.gdx.graphics.Texture;
88

9+
/**
10+
* Clase que gestiona los recursos del juego
11+
* @author Santiago Faci
12+
*
13+
*/
914
public class ResourceManager {
1015

1116
private static Map<String, Texture> textures = new HashMap<String, Texture>();
1217
private static Map<String, Sound> sounds = new HashMap<String, Sound>();
1318

19+
/**
20+
* Carga en memoria todos los recursos del juego (texturas y sonidos)
21+
*/
1422
public static void loadAllResources() {
1523

1624
Texture.setEnforcePotImages(false);
@@ -27,16 +35,31 @@ public static void loadAllResources() {
2735
ResourceManager.loadResource("white_brick", new Texture("bricks/white_brick.png"));
2836
}
2937

38+
/**
39+
* Carga un recurso en memoria
40+
* @param name
41+
* @param texture
42+
*/
3043
private static void loadResource(String name, Texture texture) {
3144

3245
textures.put(name, texture);
3346
}
3447

48+
/**
49+
* Obtiene un recurso textura de memoria
50+
* @param name
51+
* @return
52+
*/
3553
public static Texture getTexture(String name) {
3654

3755
return textures.get(name);
3856
}
3957

58+
/**
59+
* Obtiene un recurso de sonido de memoria
60+
* @param name
61+
* @return
62+
*/
4063
public static Sound getSound(String name) {
4164

4265
return sounds.get(name);

arkanoidx/src/org/sfsoft/arkanoidx/managers/SpriteManager.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@
88
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
99
import com.badlogic.gdx.utils.Array;
1010

11+
/**
12+
* Clase que gestiona los sprites del juego
13+
* @author Santiago Faci
14+
* @version 1.0
15+
*
16+
*/
1117
public class SpriteManager {
1218

1319
public Board player;

0 commit comments

Comments
 (0)