summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: bbb339b)
raw | patch | inline | side by side (parent: bbb339b)
author | fredboy <fredboy@protonmail.com> | |
Wed, 17 Apr 2024 09:18:34 +0000 (16:18 +0700) | ||
committer | fredboy <fredboy@protonmail.com> | |
Wed, 17 Apr 2024 09:18:34 +0000 (16:18 +0700) |
diff --git a/core/src/ru/deadsoftware/cavedroid/CaveGame.java b/core/src/ru/deadsoftware/cavedroid/CaveGame.java
index 8b2d66b4622d80190e4a7f83e5347210e749f6b5..8aa6f28f6fcc3077701edb0f00717fddbdeead55 100644 (file)
}
public void quitGame() {
+ if (screen != null) {
+ screen.dispose();
+ }
setScreen(mMainComponent.getMenuScreen());
}
diff --git a/core/src/ru/deadsoftware/cavedroid/game/GameScreen.java b/core/src/ru/deadsoftware/cavedroid/game/GameScreen.java
index 370d8bd79066baf1db5c385f4d89556b53c6f740..4a7d6131f87cd78dce442950e25e9babf840a79e 100644 (file)
@Override
public void dispose() {
+ if (mGameProc != null) {
+ mGameProc.dispose();
+ }
}
}
diff --git a/core/src/ru/deadsoftware/cavedroid/game/world/GameFluidsThread.java b/core/src/ru/deadsoftware/cavedroid/game/world/GameFluidsThread.java
index 7d80855ea3c772f4fb21c1d64a13b2bae1b4cd0c..c5eb8337b3810636f04efbe3a0126e1f1f142184 100644 (file)
package ru.deadsoftware.cavedroid.game.world;
-import com.badlogic.gdx.utils.TimeUtils;
import ru.deadsoftware.cavedroid.game.mobs.MobsController;
import java.util.Arrays;
private final GameWorld mGameWorld;
private final MobsController mMobsController;
- private final Thread mMainThread;
-
GameFluidsThread(GameWorld gameWorld,
- MobsController mobsController,
- Thread mainThread) {
+ MobsController mobsController) {
mGameWorld = gameWorld;
mMobsController = mobsController;
- mMainThread = mainThread;
}
private int getBlockState(int id) {
}
}
- private boolean timeToUpdate() {
- if (TimeUtils.timeSinceMillis(mFluidLastUpdateTimestamp) >= FLUID_UPDATE_INTERVAL_MS) {
- mFluidLastUpdateTimestamp = TimeUtils.millis();
- return true;
- }
- return false;
- }
-
@Override
public void run() {
fluidUpdater();
diff --git a/core/src/ru/deadsoftware/cavedroid/game/world/GameWorld.java b/core/src/ru/deadsoftware/cavedroid/game/world/GameWorld.java
index b5ac7eef895e2c280578da80c1d133cd8e036705..a908971baef7191e0f105a1dd7589978de3816a3 100644 (file)
mHeight = mForeMap[0].length;
}
- mGameFluidsThread = new GameFluidsThread(this, mMobsController, Thread.currentThread());
+ mGameFluidsThread = new GameFluidsThread(this, mMobsController);
mGameFluidsTimer = new Timer();
mGameFluidsTimer.scheduleAtFixedRate(mGameFluidsThread, 0, GameFluidsThread.FLUID_UPDATE_INTERVAL_MS);