From: fred-boy Date: Mon, 10 Sep 2018 11:47:50 +0000 (+0700) Subject: Minor changes X-Git-Tag: alpha0.4~90 X-Git-Url: http://deadsoftware.ru/gitweb?a=commitdiff_plain;h=878489009db3feb875e4a0f05de955386b7afd7d;p=cavedroid.git Minor changes --- diff --git a/core/src/ru/deadsoftware/cavecraft/game/GameRenderer.java b/core/src/ru/deadsoftware/cavecraft/game/GameRenderer.java index fac4ba2..93618f2 100644 --- a/core/src/ru/deadsoftware/cavecraft/game/GameRenderer.java +++ b/core/src/ru/deadsoftware/cavecraft/game/GameRenderer.java @@ -174,9 +174,8 @@ public class GameRenderer extends Renderer { private void drawGamePlay() { drawWorldBackground(); - //Mob.animateMobs(); - for (Mob mob : gameProc.mobs) drawMob(mob); drawPlayer(gameProc.player); + for (Mob mob : gameProc.mobs) drawMob(mob); drawWorldForeground(); drawGUI(); } diff --git a/core/src/ru/deadsoftware/cavecraft/game/mobs/Pig.java b/core/src/ru/deadsoftware/cavecraft/game/mobs/Pig.java index 44333ab..04a96f6 100644 --- a/core/src/ru/deadsoftware/cavecraft/game/mobs/Pig.java +++ b/core/src/ru/deadsoftware/cavecraft/game/mobs/Pig.java @@ -25,14 +25,15 @@ public class Pig extends Mob{ public void changeDir() { dir=-dir+1; moveX.set(-1+2*dir,0); - if (MathUtils.randomBoolean(.0025f)) { - moveX.set(0, 0); - } } @Override public void ai() { if (MathUtils.randomBoolean(.0025f)) changeDir(); + else if (MathUtils.randomBoolean(.0025f)) { + if (moveX.x != 0f) moveX.setZero(); + else moveX.set(-1+2*dir, 0); + } if (moveX.x != 0f) animation+=ANIM_SPEED; else animation=0; if (animation>=60 || animation<=-60) { ANIM_SPEED = -ANIM_SPEED;