Skip to content

Commit

Permalink
added javadoc
Browse files Browse the repository at this point in the history
  • Loading branch information
Gaganx0 committed Sep 11, 2023
1 parent 22661e2 commit 3c5bd7e
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,18 @@ private TiledMap createForestDemoTiles(GridPoint2 tileSize, TextureRegion grass)
fillTiles(grassLayer, new GridPoint2(20, 8), grassTile);
tiledMap.getLayers().add(grassLayer);

// Create lanes (invisible)
/**
* Creates lanes of invisible tiles in the TiledMap. These lanes are added as separate layers
* and are typically used for gameplay purposes.
*
* @param tiledMap The TiledMap to which the lanes should be added.
* @param tileSize The size of each tile in pixels (width and height).
* @param numberOfLanes The total number of lanes to create.
* @param mapWidth The width of the TiledMap in tiles.
* @param mapHeight The height of the TiledMap in tiles.
* @return The modified TiledMap with the added invisible lanes.
*/

int numberOfLanes = 8;
int laneHeight = 1; // Height of each lane in tiles
int mapWidth = 20;
Expand All @@ -183,6 +194,14 @@ private TiledMap createForestDemoTiles(GridPoint2 tileSize, TextureRegion grass)
return tiledMap;
}

/**
* Fills a TiledMapTileLayer with invisible tiles, creating a layer of transparent tiles.
*
* @param layer The TiledMapTileLayer to fill with invisible tiles.
* @param mapSize The size of the layer in tiles (width and height).
*/


private void fillInvisibleTiles(TiledMapTileLayer layer, GridPoint2 mapSize) {
for (int x = 0; x < mapSize.x; x++) {
for (int y = 0; y < mapSize.y; y++) {
Expand Down
17 changes: 14 additions & 3 deletions source/core/src/main/com/csse3200/game/screens/GameLevelData.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,23 @@
package com.csse3200.game.screens;

/**
* The {@code GameLevelData} class is responsible for managing the selected game level.
* It provides methods to get and set the selected game level.
*/
public class GameLevelData {
private static int selectedLevel = -1;

/**
* Get the currently selected game level.
*
* @return The selected game level.
*/
public static int getSelectedLevel() {
return selectedLevel;
}

/**
* Set the selected game level.
*
* @param level The new game level to be selected.
*/
public static void setSelectedLevel(int level) {
selectedLevel = level;
}
Expand Down

0 comments on commit 3c5bd7e

Please sign in to comment.