mirror of
https://github.com/RandomityGuy/MBHaxe.git
synced 2026-04-03 01:18:06 +00:00
try to make touch camera better
This commit is contained in:
parent
5391c665ac
commit
bc428260fa
2 changed files with 17 additions and 8 deletions
|
|
@ -87,14 +87,24 @@ class CameraInput {
|
|||
if (jumpcam) {
|
||||
scaleFactor /= Settings.touchSettings.buttonJoystickMultiplier;
|
||||
}
|
||||
if (Math.abs(delta.x) < 0.05)
|
||||
delta.x = 0;
|
||||
if (Math.abs(delta.y) < 0.05)
|
||||
delta.y = 0;
|
||||
MarbleGame.instance.world.marble.camera.orbit(applyNonlinearScale(delta.x / scaleFactor), applyNonlinearScale(delta.y / scaleFactor), true);
|
||||
if (delta.x != 0)
|
||||
var inpX = delta.x / scaleFactor;
|
||||
var inpY = delta.y / scaleFactor;
|
||||
|
||||
if (jumpcam) {
|
||||
if (Math.abs(inpX) < 1.3)
|
||||
inpX = 0;
|
||||
if (Math.abs(inpY) < 1.3)
|
||||
inpY = 0;
|
||||
}
|
||||
|
||||
var dt = MarbleGame.instance.world.timeState.dt;
|
||||
|
||||
MarbleGame.instance.world.marble.camera.orbit(applyNonlinearScale((inpX / dt) * (1 / 60.0)) * (1 / 60.0) * 20,
|
||||
applyNonlinearScale((inpY / dt) * (1 / 60.0)) * (1 / 60.0) * 20, true);
|
||||
|
||||
if (inpX != 0)
|
||||
prevMouse.x = e.relX;
|
||||
if (delta.y != 0)
|
||||
if (inpY != 0)
|
||||
prevMouse.y = e.relY;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@ class PauseButton extends TouchButton {
|
|||
|
||||
this.onClick = () -> {
|
||||
if (MarbleGame.instance.world != null && @:privateAccess !MarbleGame.instance.paused) {
|
||||
@:privateAccess MarbleGame.instance.paused = true;
|
||||
MarbleGame.instance.handlePauseGame();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue