Package com.csse3200.game.screens
Class MainGameScreen
java.lang.Object
com.badlogic.gdx.ScreenAdapter
com.csse3200.game.screens.MainGameScreen
- All Implemented Interfaces:
com.badlogic.gdx.Screen
public class MainGameScreen
extends com.badlogic.gdx.ScreenAdapter
The game screen containing the main game.
Details on libGDX screens: https://happycoding.io/tutorials/libgdx/game-screens
-
Field Summary
-
Constructor Summary
-
Method Summary
Methods inherited from class com.badlogic.gdx.ScreenAdapter
hide, show
-
Field Details
-
viewportWidth
public static int viewportWidth -
viewportHeight
public static int viewportHeight
-
-
Constructor Details
-
MainGameScreen
-
-
Method Details
-
getBackgroundTexture
public com.badlogic.gdx.graphics.Texture getBackgroundTexture()Retrieves the background texture based on the currently selected game level.The method returns different textures for each game level:
- Ice Level: "images/ice_bg.png"
- Lava Level: "images/lava_bg.png"
- Any other level: Default to "images/desert_bg.png"
- Returns:
- The background
Texture
corresponding to the selected level.
-
render
public void render(float delta) - Specified by:
render
in interfacecom.badlogic.gdx.Screen
- Overrides:
render
in classcom.badlogic.gdx.ScreenAdapter
-
resize
public void resize(int width, int height) - Specified by:
resize
in interfacecom.badlogic.gdx.Screen
- Overrides:
resize
in classcom.badlogic.gdx.ScreenAdapter
-
pause
public void pause()- Specified by:
pause
in interfacecom.badlogic.gdx.Screen
- Overrides:
pause
in classcom.badlogic.gdx.ScreenAdapter
-
resume
public void resume()- Specified by:
resume
in interfacecom.badlogic.gdx.Screen
- Overrides:
resume
in classcom.badlogic.gdx.ScreenAdapter
-
dispose
public void dispose()- Specified by:
dispose
in interfacecom.badlogic.gdx.Screen
- Overrides:
dispose
in classcom.badlogic.gdx.ScreenAdapter
-