diff --git a/core/src/ru/deadsoftware/cavecraft/game/GameProc.java b/core/src/ru/deadsoftware/cavecraft/game/GameProc.java
index 6c532ace6a77c6a6537d7b5b0196f44c3e7d08fc..2cdc302291cac2ec1c3faf961c5a8285cd261b13 100644 (file)
}
private void moveCursor() {
}
private void moveCursor() {
- if (ctrlMode==0 && CaveGame.TOUCH) {
- if (player.canJump) {
- cursorX = (int) (player.position.x + player.texWidth / 2) / 16;
- if (player.dir == 0) cursorX--;
+ if (ctrlMode == 0 && CaveGame.TOUCH) {
+ cursorX = (int) (player.position.x + player.texWidth / 2) / 16;
+ if (player.dir == 0) cursorX--;
else cursorX++;
else cursorX++;
- cursorY = (int) (player.position.y + player.texWidth) / 16;
- if (!isAutoselectable(cursorX, cursorY)) {
- cursorY++;
- }
- if (!isAutoselectable(cursorX, cursorY)) {
- cursorY++;
- }
- if (!isAutoselectable(cursorX, cursorY)) {
- if (player.dir == 0) cursorX++;
- else cursorX--;
- }
- } else {
- cursorX = (int) (player.position.x + player.texWidth / 2) / 16;
- cursorY = (int) (player.position.y + player.height+8)/16;
+ cursorY = (int) (player.position.y + player.texWidth) / 16;
+ if (!isAutoselectable(cursorX, cursorY)) {
+ cursorY++;
+ }
+ if (!isAutoselectable(cursorX, cursorY)) {
+ cursorY++;
+ }
+ if (!isAutoselectable(cursorX, cursorY)) {
+ if (player.dir == 0) cursorX++;
+ else cursorX--;
}
} else if (!CaveGame.TOUCH){
cursorX = (int)(Gdx.input.getX()*
}
} else if (!CaveGame.TOUCH){
cursorX = (int)(Gdx.input.getX()*
private void checkCursorBounds() {
if (cursorY < 0) cursorY = 0;
if (cursorY >= world.getHeight()) cursorY = world.getHeight()-1;
private void checkCursorBounds() {
if (cursorY < 0) cursorY = 0;
if (cursorY >= world.getHeight()) cursorY = world.getHeight()-1;
- if (cursorX<(player.position.x+player.texWidth/2)/16)
- player.dir=0;
- if (cursorX>(player.position.x+player.texWidth/2)/16)
- player.dir=1;
+ if (ctrlMode==1) {
+ if (cursorX*16+8<player.position.x+player.texWidth/2)
+ player.dir=0;
+ if (cursorX*16+8>player.position.x+player.texWidth/2)
+ player.dir=1;
+ }
}
public void update(float delta) {
}
public void update(float delta) {