Skip to content

Commit

Permalink
Java Doc Added
Browse files Browse the repository at this point in the history
  • Loading branch information
aadityayadav17 committed Oct 2, 2023
1 parent 1bcf302 commit 9f11505
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ public void create() {
addActors();
}

/**
* Adds various actors to the stage for the settings screen.
* This method sets up and adds elements such as a custom cursor, background image, title label, settings table, and menu buttons.
*/
private void addActors() {
// Load the custom cursor image
Pixmap cursorPixmap = new Pixmap(Gdx.files.internal("images/ui/mouse_effect.png"));
Expand Down
14 changes: 14 additions & 0 deletions source/core/src/main/com/csse3200/game/screens/MainMenuScreen.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ public MainMenuScreen(GdxGame game) {
createUI();
}

/**
* Loads the assets required for the main menu screen, including textures and animations.
* This method initializes and loads sprite sheets for various celestial objects like stars, planets, and galaxies.
* Each sprite sheet is divided into individual frames for animation purposes.
*/
@Override
public void render(float delta) {
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
Expand Down Expand Up @@ -197,6 +202,11 @@ public void dispose() {
ServiceLocator.clear();
}

/**
* Loads the assets required for the main menu screen, including textures and animations.
* This method initializes and loads sprite sheets for various celestial objects such as stars, galaxies, and planets.
* Each sprite sheet is divided into individual frames for animation purposes.
*/
private void loadAssets() {
logger.debug("Loading assets");
ResourceService resourceService = ServiceLocator.getResourceService();
Expand Down Expand Up @@ -290,6 +300,10 @@ private void loadAssets() {
ServiceLocator.getResourceService().loadAll();
}

/**
* Unloads the assets that were previously loaded for the main menu screen.
* This method disposes of textures and sprite sheets used for celestial objects such as stars, galaxies, and planets.
*/
private void unloadAssets() {
logger.debug("Unloading assets");
ResourceService resourceService = ServiceLocator.getResourceService();
Expand Down
24 changes: 24 additions & 0 deletions source/core/src/main/com/csse3200/game/screens/SettingsScreen.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ public SettingsScreen(GdxGame game) {
createUI();
}

/**
* Renders the main gameplay screen.
*
* @param delta The time elapsed since the last frame in seconds.
*/
@Override
public void render(float delta) {
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
Expand All @@ -66,6 +71,12 @@ public void render(float delta) {
renderer.render();
}

/**
* Called when the game window is resized.
*
* @param width The new width of the window.
* @param height The new height of the window.
*/
@Override
public void resize(int width, int height) {
renderer.resize(width, height);
Expand All @@ -75,6 +86,11 @@ public void resize(int width, int height) {
renderer.resize(width, height);
}

/**
* Disposes of resources and services associated with the main menu screen.
* This method performs cleanup tasks such as disposing of the renderer, unloading assets, disposing of the render service,
* disposing of the entity service, disposing of the batch, and clearing the service locator.
*/
@Override
public void dispose() {
logger.debug("Disposing main menu screen");
Expand All @@ -87,6 +103,10 @@ public void dispose() {
ServiceLocator.clear();
}

/**
* Loads the assets required for the settings screen.
* This method initializes and loads textures, including the background texture and any other assets specified in SettingsTextures.
*/
private void loadAssets() {
logger.debug("Loading assets");
ResourceService resourceService = ServiceLocator.getResourceService();
Expand All @@ -95,6 +115,10 @@ private void loadAssets() {
ServiceLocator.getResourceService().loadAll();
}

/**
* Unloads the assets that were previously loaded for the settings screen.
* This method disposes of textures and assets specified in SettingsTextures to release resources.
*/
private void unloadAssets() {
logger.debug("Unloading assets");
ResourceService resourceService = ServiceLocator.getResourceService();
Expand Down

0 comments on commit 9f11505

Please sign in to comment.