add EnvironmentManager and Lighting classes for enhanced environment rendering

This commit is contained in:
2025-12-13 13:03:50 +01:00
parent 42ed4dd099
commit 4b9c0006a6
3 changed files with 100 additions and 0 deletions

View File

@@ -6,6 +6,7 @@ import de.miaurizius.jgame2d.core.enums.Map;
import de.miaurizius.jgame2d.core.handlers.*;
import de.miaurizius.jgame2d.entity.Entity;
import de.miaurizius.jgame2d.entity.Player;
import de.miaurizius.jgame2d.environment.EnvironmentManager;
import de.miaurizius.jgame2d.tile.TileManager;
import de.miaurizius.jgame2d.tile.interactive.InteractiveTile;
@@ -56,6 +57,7 @@ public class GamePanel extends JPanel implements Runnable {
public Sound music = new Sound();
public Config config = new Config(this);
public PathFinder pFinder = new PathFinder(this);
public EnvironmentManager eManager = new EnvironmentManager(this);
Thread gameThread;
// ENTITY AND OBJECT
@@ -177,6 +179,10 @@ public class GamePanel extends JPanel implements Runnable {
for(Entity entity : entityList) entity.draw(fg2);
entityList.clear();
// ENVIRONMENT
eManager.draw(fg2);
// UI
ui.draw(fg2);
long drawEnd = System.nanoTime();
@@ -229,6 +235,7 @@ public class GamePanel extends JPanel implements Runnable {
assetSetter.setNPC();
assetSetter.setMonster();
assetSetter.setITiles();
eManager.setup();
gameState = GameState.TITLE;
tempScreen = new BufferedImage(screenWidth, screenHeight, BufferedImage.TYPE_INT_RGB);