}
}
private boolean collides(int xa, int ya) {
if (level instanceof TiledLevel) {
TiledLevel level = (TiledLevel) this.level;
for (int c = 0; c < 4; c++) {
int xt = ((x + xa) - c % 2 * getWidth()) / level.getTileSize();
int yt = ((y + ya) - c / 2 * getHeight()) / level.getTileSize();
// System.out.println(xt + ", " + yt);
if (level.getTile(xt, yt) == null) continue;
if (level.getTile(xt, yt).solid()) {
return true;
}
}
}
return false;