remoteMap animated radar

This commit is contained in:
Danielv123 committed 2018-03-26 14:03:57 +02:00
1 parent fb3d27abef
commit 47637f5511
2 files changed
+9 -3

No files matched your search

+7 -2
View File
@@ -494,9 +494,14 @@ function drawEntity(entity, dontCache){
};
}
} else {
// correct for whether we have 4 or 8 directions
// correct for whether we have 1, 4 or 8 directions
let spriteSheetRotIndex = dir / (8 / rules.spritesheet.length);
if(rules.spritesheet[spriteSheetRotIndex].spritesheet.length){
if(rules.spritesheet.length > 8) {
// apparently this entity has more than 8 directions. That isn't supported.
// therefore we can conclude that they are instead intended as animation frames.
// That is why we treat them as animation frames.
spriteSheetRotIndex = Math.floor(Date.now()/32) % rules.spritesheet.length;
} else if(rules.spritesheet[spriteSheetRotIndex].spritesheet.length){
var animationStage = Math.floor(Date.now()/16) % rules.spritesheet[spriteSheetRotIndex].spritesheet.length;
var usesAnimation = true;
} else {