summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 2aa65a4)
raw | patch | inline | side by side (parent: 2aa65a4)
author | fredboy <fredboy@protonmail.com> | |
Mon, 15 Apr 2024 12:38:12 +0000 (19:38 +0700) | ||
committer | fredboy <fredboy@protonmail.com> | |
Mon, 15 Apr 2024 13:07:21 +0000 (20:07 +0700) |
diff --git a/android/build.gradle b/android/build.gradle
index 106767b94df2c8480cf155c87cc39b476c3e93af..f0e5e52042015e41914807c39ed74b2f344b19bc 100644 (file)
--- a/android/build.gradle
+++ b/android/build.gradle
applicationIdSuffix ".debug"
}
}
+ buildFeatures {
+ buildConfig true
+ }
}
diff --git a/android/src/ru/deadsoftware/cavedroid/AndroidLauncher.java b/android/src/ru/deadsoftware/cavedroid/AndroidLauncher.java
index 3019a9e767da7f04feae1aa5062aa0a3a2b2744b..88b62619bd1aebbc267b64bc45982bf540fc3808 100644 (file)
import android.os.Bundle;
import com.badlogic.gdx.backends.android.AndroidApplication;
import com.badlogic.gdx.backends.android.AndroidApplicationConfiguration;
-import com.badlogic.gdx.backends.android.BuildConfig;
public class AndroidLauncher extends AndroidApplication {
@Override
diff --git a/core/src/ru/deadsoftware/cavedroid/game/GameInput.java b/core/src/ru/deadsoftware/cavedroid/game/GameInput.java
index 3da4e2e10c44b28e88bfb0236878acab48c15de6..7221d1658f61d16f080f6f1f4c130b483e60b75b 100644 (file)
if (checkSwim()) {
mPlayer.swim = true;
} else if (mPlayer.canJump()) {
- mPlayer.getVelocity().add(0, -180);
+ mPlayer.getVelocity().add(0, GamePhysics.PL_JUMP_VELOCITY);
} else if (!mPlayer.isFlyMode() && mPlayer.gameMode == 1) {
mPlayer.setFlyMode(true);
mPlayer.getVelocity().y = 0;
}
public void touchDragged(float screenX, float screenY) {
+ if (Math.abs(screenX - mTouchDownX) < 16 && Math.abs(screenY - mTouchDownY) < 16) {
+ return;
+ }
+
mDragging = true;
if (mMainConfig.checkGameUiWindow(GameUiWindow.CREATIVE_INVENTORY) && Math.abs(screenY - mTouchDownY) > 16) {
if (insideCreativeInv(screenX, screenY)) {
diff --git a/core/src/ru/deadsoftware/cavedroid/game/GamePhysics.java b/core/src/ru/deadsoftware/cavedroid/game/GamePhysics.java
index 8d5d24c2e5685819a73e34b1f96612da3f0fdaf0..7d13744d9260f7cfb86774641ff70e57c0d67930 100644 (file)
@GameScope
public class GamePhysics {
- public static final int PL_SPEED = 120;
+ public static final float PL_SPEED = 69.072f;
+ public static final float PL_JUMP_VELOCITY = -133.332f;
- private final Vector2 gravity = new Vector2(0, .09f);
+ private final Vector2 gravity = new Vector2(0, 444.44f);
private final GameWorld mGameWorld;
private final MainConfig mMainConfig;
}
} else {
if (!player.isFlyMode() && player.getVelocity().y < 1080) {
- player.getVelocity().add(gravity);
+ player.getVelocity().y += gravity.y * delta;
}
}
mobXColl(player);
if (mMainConfig.isTouch() && !player.isFlyMode() && player.canJump() && player.getVelocity().x != 0 && checkJump(player)) {
- player.getVelocity().add(0, -480);
+ player.getVelocity().y = PL_JUMP_VELOCITY;
player.setCanJump(false);
}
}
diff --git a/core/src/ru/deadsoftware/cavedroid/game/GameRenderer.java b/core/src/ru/deadsoftware/cavedroid/game/GameRenderer.java
index 44ec9baeff02942ed911db177e86aee41027e074..84cea1be3d19cf995ba6b92d8ee07a11b65663ed 100644 (file)
drawString("Y: " + player.getUpperMapY(), 0, 20);
drawString("CurX: " + mGameInput.getCurX(), 0, 30);
drawString("CurY: " + mGameInput.getCurY(), 0, 40);
- drawString("Mobs: " + mMobsController.getSize(), 0, 50);
- drawString("Drops: " + mDropController.getSize(), 0, 60);
- drawString("Block: " + GameItems.getBlockKey(mGameWorld.getForeMap(mGameInput.getCurX(), mGameInput.getCurY())), 0, 70);
- drawString("Hand: " + GameItems.getItemKey(mMobsController.getPlayer().inventory[mMobsController.getPlayer().slot]), 0, 80);
- drawString("Game mode: " + player.gameMode, 0, 90);
+ drawString("Velocity: " + player.getVelocity(), 0, 50);
+ drawString("Mobs: " + mMobsController.getSize(), 0, 60);
+ drawString("Drops: " + mDropController.getSize(), 0, 70);
+ drawString("Block: " + GameItems.getBlockKey(mGameWorld.getForeMap(mGameInput.getCurX(), mGameInput.getCurY())), 0, 80);
+ drawString("Hand: " + GameItems.getItemKey(mMobsController.getPlayer().inventory[mMobsController.getPlayer().slot]), 0, 90);
+ drawString("Game mode: " + player.gameMode, 0, 100);
spriter.end();
}