summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 834fd02)
raw | patch | inline | side by side (parent: 834fd02)
author | fredboy <fredboy@protonmail.com> | |
Sun, 14 Apr 2024 20:15:42 +0000 (03:15 +0700) | ||
committer | fredboy <fredboy@protonmail.com> | |
Sun, 14 Apr 2024 20:15:42 +0000 (03:15 +0700) |
core/src/ru/deadsoftware/cavedroid/game/GameInput.java | patch | blob | history |
diff --git a/core/src/ru/deadsoftware/cavedroid/game/GameInput.java b/core/src/ru/deadsoftware/cavedroid/game/GameInput.java
index 09a7e7056383298ecddde2ccc2fdf890a9298dd1..2376bb110d28e9ee1f8c30639c5c9ac8d34fd5f2 100644 (file)
mCurX += mPlayer.looksLeft() ? 1 : -1;
}
} else if (!mMainConfig.isTouch()) {
- mCurX = (int) (Gdx.input.getX() * (mMainConfig.getWidth() /
- Gdx.graphics.getWidth()) + gameRenderer.getCamX()) / 16;
+ final int tmpX = (int) (Gdx.input.getX() * (mMainConfig.getWidth() /
+ Gdx.graphics.getWidth()) + gameRenderer.getCamX());
+ mCurX = tmpX / 16;
mCurY = (int) (Gdx.input.getY() * (mMainConfig.getHeight() /
Gdx.graphics.getHeight()) + gameRenderer.getCamY()) / 16;
- if (mCurX < 0) {
+ if (tmpX < 0) {
mCurX--;
}
}