- if (canJump && position.x>16 && position.x<(gameProc.world.getWidth()-1)*16 &&
- gameProc.world.getForeMap((int)(position.x/16)+(dir*2-1), (int)((position.y+height)/16))>0 &&
- gameProc.world.getForeMap((int)(position.x/16)+(dir*2-1), (int)((position.y)/16))==0)
- moveY.add(0, -8);
- if (MathUtils.randomBoolean(.0001f)) dir++;
- if (dir>1) dir = 0;
- moveX.set(-1.5f+3*dir,0);