public void update() { move(); if (walking) animSprite.update(); else animSprite.setFrame(0); if (ya < 0) { dir = Direction.UP; animSprite = up; } else if (ya > 0) { dir = Direction.DOWN; animSprite = down; } if (xa < 0) { dir = Direction.LEFT; animSprite = left; } else if (xa > 0) { dir = Direction.RIGHT; animSprite = right; } }
public void render(Screen screen) { sprite = animSprite.getSprite(); screen.renderMob((int) (x - 16), (int) (y - 16), this); }