- commit
- 20487f2430e654da47347775ce7a61bf226f47c4
- parent
- 0c90216e35c4613f3a5a7cfbec237ce63ca14f0f
- Author
- Tobias Bengfort <tobias.bengfort@posteo.de>
- Date
- 2024-10-05 08:51
do not draw the ladder on top of objects
Diffstat
| M | static/main.js | 6 | +++--- |
1 files changed, 3 insertions, 3 deletions
diff --git a/static/main.js b/static/main.js
@@ -136,15 +136,15 @@ var game = {
136 136 obj => obj.type === 'player' && this.inView(obj.pos, {x, y})
137 137 );
138 138
139 -1 if (x === this.ladder.x && y === this.ladder.y) {
140 -1 return ['>', inView() ? -1 : 0];
141 -1 }
142 139 var objs = Object.values(this.objects).filter(obj => x === obj.pos.x && y === obj.pos.y);
143 140 for (const obj of objs) {
144 141 if (obj.type === 'player' || inView()) {
145 142 return [obj.rune, COLORS[obj.type]];
146 143 }
147 144 }
-1 145 if (x === this.ladder.x && y === this.ladder.y) {
-1 146 return ['>', inView() ? -1 : 0];
-1 147 }
148 148 if (this.getRect({x, y})) {
149 149 return ['.', inView() ? -1 : 0];
150 150 }