Portal's texture done

This commit is contained in:
Mathieu 2020-04-15 15:01:55 +02:00
parent d39470e3ca
commit 7d0ba7923f
2 changed files with 5 additions and 2 deletions

BIN
assets/map/portal.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 186 KiB

View File

@ -89,6 +89,9 @@ imgGrass.title = "It is just grass.."
const imgIce = new Image(); const imgIce = new Image();
imgIce.src = './assets/map/ice.jpg' imgIce.src = './assets/map/ice.jpg'
imgIce.title = "Ice is a slippery slope.. You can not turn on it !" imgIce.title = "Ice is a slippery slope.. You can not turn on it !"
const imgPortal = new Image();
imgPortal.src = './assets/map/portal.gif'
imgPortal.title = "This portal can transport you into the next portal."
// Get wall texture // Get wall texture
const imgWall = new Image(); const imgWall = new Image();
@ -143,6 +146,7 @@ function showRulesScreen() {
// Display map texture // Display map texture
mapList.appendChild(imgGrass) mapList.appendChild(imgGrass)
mapList.appendChild(imgIce); mapList.appendChild(imgIce);
mapList.appendChild(imgPortal);
} }
@ -358,8 +362,7 @@ async function startGame(gameID) {
break; break;
case TELEPORTATION: case TELEPORTATION:
ctx.fillStyle = "gray"; ctx.drawImage(imgPortal, x*cell_width, y*cell_height, cell_width, cell_height);
ctx.fillRect(x*cell_width, y*cell_height, cell_width, cell_height)
break; break;
case ICE: case ICE: