Remove inheritance from Tile class - and remove descendants

Inheritance turned out to be too rigid - all child classes needed all
properties anyway, so no utility gained from polymorphism
This commit is contained in:
Kim Ravn Hansen
2025-10-13 11:29:00 +02:00
parent 96f8781e23
commit ccb3cdb0ce
6 changed files with 164 additions and 83 deletions

View File

@@ -176,16 +176,16 @@ export class FirstPersonRenderer {
}
if (tile.looksLikeWall) {
if (!this.map.looksLikeWall(x, y + 1)) {
if (!this.map.behavesLikeWall(x, y + 1)) {
wallPlanes.push([x, y + 0.5, Math.PI * 0.0]);
}
if (!this.map.looksLikeWall(x + 1, y)) {
if (!this.map.behavesLikeWall(x + 1, y)) {
wallPlanes.push([x + 0.5, y, Math.PI * 0.5]);
}
if (!this.map.looksLikeWall(x, y - 1)) {
if (!this.map.behavesLikeWall(x, y - 1)) {
wallPlanes.push([x, y - 0.5, Math.PI * 1.0]);
}
if (!this.map.looksLikeWall(x - 1, y)) {
if (!this.map.behavesLikeWall(x - 1, y)) {
wallPlanes.push([x - 0.5, y, Math.PI * 1.5]);
}
return;