コード例 #1
0
  @Override
  public void handle(long now) {
    this.gc.setFill(Color.WHITE);
    this.gc.fillRect(0, 0, Game.SCENE_WIDTH, Game.SCENE_HEIGHT);

    this.gc.setFill(Color.BLACK);
    synchronized (this.entities) {
      for (Entity<?> entity : this.entities) {
        this.gc.fillRect(
            entity.getLocation().getX() * Game.SCALE - this.cameraPos.getX(),
            entity.getLocation().getY() * Game.SCALE - this.cameraPos.getY(),
            entity.getHitbox().getWidth() * Game.SCALE,
            entity.getHitbox().getHeight() * Game.SCALE);
      }
    }
  }