laneya2

cave exploration game
git clone https://git.ce9e.org/laneya2.git

commit
0cf62dc5b422174ae8df261f07346e1826fbc83a
parent
e9f8f9a653f2443e6b788c860361efba02b25872
Author
Tobias Bengfort <tobias.bengfort@posteo.de>
Date
2024-10-05 23:13
fix draw priority: moving on top of piles

Diffstat

M static/main.js 12 +++++++++++-

1 files changed, 11 insertions, 1 deletions


diff --git a/static/main.js b/static/main.js

@@ -132,7 +132,17 @@ var game = {
  132   132 
  133   133         var objs = Object.values(this.objects).filter(obj => x === obj.pos.x && y === obj.pos.y);
  134   134         for (const obj of objs) {
  135    -1             if (obj.type === 'player' || inView()) {
   -1   135             if (obj.type === 'player') {
   -1   136                 return [obj.rune, COLORS[obj.type]];
   -1   137             }
   -1   138         }
   -1   139         if (inView()) {
   -1   140             for (const obj of objs) {
   -1   141                 if (obj.type === 'monster') {
   -1   142                     return [obj.rune, COLORS[obj.type]];
   -1   143                 }
   -1   144             }
   -1   145             for (const obj of objs) {
  136   146                 return [obj.rune, COLORS[obj.type]];
  137   147             }
  138   148         }