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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user