Amélioration visuelle des tuiles

This commit is contained in:
Didictateur 2025-03-30 10:00:03 +02:00
parent 4504545ef8
commit 08be64289a
2 changed files with 31 additions and 16 deletions

View file

@ -158,7 +158,7 @@
} }
//script initial //script initial
loadScript('dp0.js'); loadScript('dp1.js');
</script> </script>
</body> </body>
</html> </html>

View file

@ -59,27 +59,42 @@ export class Tile {
} }
if (hidden) { if (hidden) {
ctx.drawImage( ctx.drawImage( // ombre
this.imgGray,
-(75 * size * 0.92) / 2,
-(100 * size * 0.91) / 2,
75 * size,
100 * size
);
ctx.drawImage( // le dos des tuiles
this.imgBack, this.imgBack,
-(75 * size) / 2, -(75 * size) / 2,
-(100 * size) / 2, -(100 * size) / 2,
75 * size, 100 * size
);
} else {
ctx.drawImage(
this.imgFront,
-(75 * size) / 2,
-(100 * size) / 2,
75 * size, 100 * size
);
ctx.drawImage(
this.img,
-(75 * size) / 2,
-(100 * size) / 2,
75 * size, 75 * size,
100 * size 100 * size
); );
if (gray) { } else {
ctx.drawImage( // ombre
this.imgGray,
-(75 * size * 0.92) / 2,
-(100 * size * 0.91) / 2,
75 * size,
100 * size
);
ctx.drawImage( // tuile à vide
this.imgFront,
-(75 * size) / 2,
-(100 * size) / 2,
75 * size, 100 * size
);
ctx.drawImage( // le dessin sur la tuile
this.img,
-((75 - 7) * size) / 2,
-((100 - 10) * size) / 2,
75 * size * 0.9,
100 * size * 0.9
);
if (gray) { // grisé
ctx.drawImage( ctx.drawImage(
this.imgGray, this.imgGray,
-(75 * size) / 2, -(75 * size) / 2,