Javascript-форум (https://javascript.ru/forum/)
-   Общие вопросы Javascript (https://javascript.ru/forum/misc/)
-   -   Не работает Canvas на HTML (https://javascript.ru/forum/misc/77804-ne-rabotaet-canvas-na-html.html)

flyrixxx1 23.06.2019 16:58

Не работает Canvas на HTML
 
опять не работает змейка на html. пишет, что отсутствует скобка в 29й строке после списка аргументов, хотя она там есть.
<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<title>kavo</title>
</head>
<body>


	<canvas id="canvas" width="400" height="400"></canvas>
	<script src="https://code.jquery.com/jquery-2.1.0.js"></script>


	<script>
var canvas = document.getElementById("canvas");
var ctx = canvas.getContext("2d");
var width = canvas.width;
var height = canvas.height;
var blocksize = 10;
var widthinblocks = width / blocksize;
var heightinblocks = height / blocksize;
var score = 0;
var drawborder = function () {
	ctx.filStyle = "Gray";
	ctx.fillRect(0, 0, width, blocksize);
	ctx.fillRect(0, height - blocksize, width, blocksize);
	ctx.fillRect(0, 0, blocksize, height);
	ctx.fillRect(width - blocksize, 0, blocksize, height);
	ctx.fillText("текст" 50, 50);
	ctx.textBaseline = "top";
	ctx.fillText("текст", 50, 50);
	ctx.font = "20px Courier";
	ctx.fillText("Courier", 50, 50);
};
drawborder ();
	</script>
</body>
</html>

Alexandroppolus 23.06.2019 17:03

Цитата:

Сообщение от flyrixxx1
отсутствует скобка в 29й строке

Там запятой не хватает

flyrixxx1 23.06.2019 17:16

Alexandroppolus,
спасибо)


Часовой пояс GMT +3, время: 21:17.