summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3fdc229)
raw | patch | inline | side by side (parent: 3fdc229)
author | fredboy <fredboy@protonmail.com> | |
Wed, 17 Apr 2024 12:34:44 +0000 (19:34 +0700) | ||
committer | fredboy <fredboy@protonmail.com> | |
Wed, 17 Apr 2024 12:34:44 +0000 (19:34 +0700) |
core/src/ru/deadsoftware/cavedroid/game/model/world/generator/WorldGeneratorConfig.kt | patch | blob | history | |
core/src/ru/deadsoftware/cavedroid/game/world/GameWorld.java | patch | blob | history |
diff --git a/core/src/ru/deadsoftware/cavedroid/game/model/world/generator/WorldGeneratorConfig.kt b/core/src/ru/deadsoftware/cavedroid/game/model/world/generator/WorldGeneratorConfig.kt
index ea34209617fc068790351dfa885339d4fdd372fe..19a7c2d56719d485a7b2ff7c774658be2a9625ca 100644 (file)
private const val DEFAULT_HEIGHT = 256
private const val DEFAULT_MIN_BIOME_SIZE = 64
- fun getDefaultWithSeed(): WorldGeneratorConfig {
+ fun getDefault(): WorldGeneratorConfig {
return WorldGeneratorConfig(
width = DEFAULT_WIDTH,
height = DEFAULT_HEIGHT,
diff --git a/core/src/ru/deadsoftware/cavedroid/game/world/GameWorld.java b/core/src/ru/deadsoftware/cavedroid/game/world/GameWorld.java
index b616424c313634ddb7e92fabf594969394cff0b5..31d842b331e85768e3ff9369c26e93c0160c361b 100644 (file)
package ru.deadsoftware.cavedroid.game.world;
import com.badlogic.gdx.utils.Disposable;
-import com.badlogic.gdx.utils.TimeUtils;
import kotlin.Pair;
import ru.deadsoftware.cavedroid.game.GameItems;
import ru.deadsoftware.cavedroid.game.GameScope;
import javax.annotation.CheckForNull;
import javax.inject.Inject;
-import java.sql.Time;
import java.util.Timer;
@GameScope
public class GameWorld implements Disposable {
- private static final int DEFAULT_WIDTH = 1024;
- private static final int DEFAULT_HEIGHT = 256;
private static final int UPDATE_RANGE = 16;
private final DropController mDropController;
boolean isNewGame = foreMap == null || backMap == null;
if (isNewGame) {
- mWidth = DEFAULT_WIDTH;
- mHeight = DEFAULT_HEIGHT;
- Pair<int[][], int[][]> maps = new GameWorldGenerator(WorldGeneratorConfig.Companion.getDefaultWithSeed()).generate();
+ final WorldGeneratorConfig config = WorldGeneratorConfig.Companion.getDefault();
+ mWidth = config.getWidth();
+ mHeight = config.getHeight();
+ Pair<int[][], int[][]> maps = new GameWorldGenerator(config).generate();
mForeMap = maps.getFirst();
mBackMap = maps.getSecond();
mMobsController.getPlayer().respawn(this);