diff --git a/src/cl/cromer/game/Escenario.java b/src/cl/cromer/game/Escenario.java index 9fe13ed..1e1be2f 100644 --- a/src/cl/cromer/game/Escenario.java +++ b/src/cl/cromer/game/Escenario.java @@ -85,6 +85,8 @@ public class Escenario extends JComponent implements Constantes { /** * Initialize the scene + * + * @param canvas The canvas that this scene is in */ public Escenario(Lienzo canvas) { logger = getLogger(this.getClass(), ESCENARIO_LOG_LEVEL); diff --git a/src/cl/cromer/game/object/Enemy.java b/src/cl/cromer/game/object/Enemy.java index 5226ed0..f554366 100644 --- a/src/cl/cromer/game/object/Enemy.java +++ b/src/cl/cromer/game/object/Enemy.java @@ -65,10 +65,13 @@ public class Enemy implements Runnable, Constantes { */ private Lock lock; + // TODO: the cell is not needed, just it's x and y position /** * Initialize the enemy * * @param escenario The scene the enemy is in + * @param celda The cell this enemy is in + * @param lock The lock used to prevent the threads from conflicting */ public Enemy(Escenario escenario, Celda celda, Lock lock) { this.lock = lock; @@ -88,7 +91,6 @@ public class Enemy implements Runnable, Constantes { public void setCoordinates(int x, int y) { this.x = x; this.y = y; - celda.setCoords(x, y); } /** diff --git a/src/cl/cromer/game/sound/Sound.java b/src/cl/cromer/game/sound/Sound.java index 325576b..52e69e5 100644 --- a/src/cl/cromer/game/sound/Sound.java +++ b/src/cl/cromer/game/sound/Sound.java @@ -44,6 +44,7 @@ public class Sound implements Constantes { * Load the sound * * @param path The path to the sound resource + * @throws SoundException Thrown if the sound file could not be loaded */ public Sound(String path) throws SoundException { this.path = path; @@ -83,6 +84,7 @@ public class Sound implements Constantes { /** * Play the sound + * @throws SoundException Thrown if the sound clip is null */ public void play() throws SoundException { if (sound == null) { @@ -95,6 +97,7 @@ public class Sound implements Constantes { /** * Stop the sound + * @throws SoundException Thrown if the sound clip is null */ public void stop() throws SoundException { if (sound == null) { @@ -116,6 +119,7 @@ public class Sound implements Constantes { * Set the volume of the sound * * @param volume Volume between 0f and 1f + * @throws SoundException Thrown if the sound clip is null or the volume is out of range */ public void setVolume(float volume) throws SoundException { if (sound == null) { diff --git a/src/cl/cromer/game/sprite/Animation.java b/src/cl/cromer/game/sprite/Animation.java index 77e3bc1..67c85af 100644 --- a/src/cl/cromer/game/sprite/Animation.java +++ b/src/cl/cromer/game/sprite/Animation.java @@ -148,8 +148,9 @@ public class Animation implements Cloneable, Constantes { } /** - * Add an image to the sprite + * Add an image to the animation * + * @param direction The direction to add the image to * @param path The path to the sprite e.g. res/player/image.png */ public void addImage(Direction direction, String path) { @@ -164,14 +165,21 @@ public class Animation implements Cloneable, Constantes { } /** - * Add an image to the sprite + * Add an image to the animation * + * @param direction The direction to add the image to * @param bufferedImage The path to the sprite e.g. res/player/image.png */ public void addImage(Direction direction, BufferedImage bufferedImage) { addImageToList(direction, bufferedImage); } + /** + * Add an image to the list of images + * + * @param direction The direction to add the image to + * @param bufferedImage The image to add + */ private void addImageToList(Direction direction, BufferedImage bufferedImage) { calculateXOffset(bufferedImage.getWidth()); calculateYOffset(bufferedImage.getHeight()); diff --git a/src/cl/cromer/game/sprite/Sheet.java b/src/cl/cromer/game/sprite/Sheet.java index b444666..135b938 100644 --- a/src/cl/cromer/game/sprite/Sheet.java +++ b/src/cl/cromer/game/sprite/Sheet.java @@ -36,6 +36,8 @@ public class Sheet implements Constantes { * Initialize the texture collection * * @param path The path to the image + * @param height The height of the textures in the image + * @param width The width of the textures in the image */ public Sheet(String path, int height, int width) { images = new ArrayList<>(); @@ -62,6 +64,7 @@ public class Sheet implements Constantes { * Returns the selected texture * * @return Returns the current texture + * @param textureNumber The texture to get from the collection * @throws SheetException Thrown when there are no images in the texture collection */ public BufferedImage getTexture(int textureNumber) throws SheetException {