Description of textures added

This commit is contained in:
Mathieu 2020-03-31 16:30:07 +02:00
parent 4fe4cc66c3
commit 87b80d30d8
3 changed files with 18 additions and 11 deletions

View File

@ -72,4 +72,5 @@ canvas {
img {
height: 50px;
width: 50px;
margin: 2px;
}

View File

@ -38,6 +38,7 @@
<br>
<h2>Know everything about the different blocks :</h2>
<h3>(Put your mouse over a texture)</h3>
Food :
<div id="foodList"></div>

View File

@ -83,31 +83,36 @@ const scoreTarget = byId("scoreTarget")
// Get map texture
const imgGrass = new Image();
imgGrass.src = './assets/map/grass.png';
imgGrass.src = './assets/map/grass.png'
imgGrass.title = "It is just grass.."
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 !"
// Get wall texture
const imgWall = new Image();
imgWall.src = './assets/wall/wall.jpg';
imgWall.src = './assets/wall/wall.jpg'
imgWall.title = "It is a brick wall.. Do not try to destroy it with your snake !"
// Get food texture
const imgApple = new Image();
imgApple.src = './assets/food/apple.png';
imgApple.src = './assets/food/apple.png'
imgApple.title = "Food is food, go get the apple !"
const imgCherry = new Image();
imgCherry.src = './assets/food/cherry.png';
imgCherry.src = './assets/food/cherry.png'
imgCherry.title = "Do you want to eat some cherries ? Too bad, it is not in the game for now..."
// Get snake texture
let imgSnakeHeadUp = new Image();
imgSnakeHeadUp.src = './assets/snake/snake_head_up.png';
imgSnakeHeadUp.src = './assets/snake/snake_head_up.png'
let imgSnakeHeadLeft = new Image();
imgSnakeHeadLeft.src = './assets/snake/snake_head_left.png';
imgSnakeHeadLeft.src = './assets/snake/snake_head_left.png'
let imgSnakeHeadRight = new Image();
imgSnakeHeadRight.src = './assets/snake/snake_head_right.png';
imgSnakeHeadRight.src = './assets/snake/snake_head_right.png'
let imgSnakeHeadDown = new Image();
imgSnakeHeadDown.src = './assets/snake/snake_head_down.png';
imgSnakeHeadDown.src = './assets/snake/snake_head_down.png'
const imgSnakeBody = new Image();
imgSnakeBody.src = './assets/snake/snake_body.png';
imgSnakeBody.src = './assets/snake/snake_body.png'
/**
@ -135,7 +140,7 @@ function showRulesScreen() {
wallList.appendChild(imgWall);
// Display map texture
mapList.appendChild(imgGrass);
mapList.appendChild(imgGrass)
mapList.appendChild(imgIce);
}