コード例 #1
0
ファイル: Crawler.java プロジェクト: xflash/tg
  public void render(GameContainer gc, Graphics gfx) throws SlickException {
    Point pt = playMap.getPos();
    if (path != null) {
      for (int i = 0; i < path.getLength(); i++) {
        Path.Step step = path.getStep(i);
        gfx.setColor(Color.white);
        gfx.drawRect(
            pt.getX() + step.getX() * playMap.getTileWidth(),
            pt.getY() + step.getY() * playMap.getTileHeight(),
            playMap.getTileWidth(),
            playMap.getTileHeight());
      }
    }

    if (pathStep != null) {
      Point foe = new Point(pt);
      gfx.drawOval(
          foe.getX() + pathStep.getX() * playMap.getTileWidth() + 4,
          foe.getY() + pathStep.getY() * playMap.getTileHeight() + 4,
          9,
          9);
    }
  }