mirror of
https://github.com/neogeek23/neogeek23.github.io.git
synced 2026-02-04 10:58:21 +00:00
Add files via upload
This commit is contained in:
parent
2e46e95839
commit
c1849faf1c
@ -7,12 +7,12 @@ body{
|
|||||||
width: calc(95% - 2px);
|
width: calc(95% - 2px);
|
||||||
margin-top: 5%;
|
margin-top: 5%;
|
||||||
border: 1px white solid;
|
border: 1px white solid;
|
||||||
/*border-radius: 4px;*/
|
border-radius: 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media only screen and (min-width: 1000px) {
|
@media only screen and (min-width: 1000px) {
|
||||||
#board{
|
#board{
|
||||||
width: 1000px;
|
width: 1000px;
|
||||||
/*border-radius: 8px;*/
|
border-radius: 8px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,10 +1,15 @@
|
|||||||
<!doctype html>
|
<!doctype html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<script src="snake.js"></script>
|
<script src="snake/snake.js"></script>
|
||||||
<link rel="stylesheet" href="snake.css">
|
<link rel="stylesheet" href="snake/snake.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
<div class="instructions">Game is controlled via WASD. Running into the edge or youself results in death and starting over. You are the red snake, hunting the green snack causing the snake to grow. You are never able to slow down; you have no regrets, and you remain hungry.</div>
|
||||||
<canvas id="board"></canvas>
|
<canvas id="board"></canvas>
|
||||||
|
<div class="score_zone">
|
||||||
|
<div class="points_scored"></div>
|
||||||
|
<div class="point_rate"></div>
|
||||||
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@ -43,16 +43,6 @@ function update(canvas, canvas_context, snek){
|
|||||||
function paint_background(canvas, canvas_context){
|
function paint_background(canvas, canvas_context){
|
||||||
canvas_context.fillStyle = "white";
|
canvas_context.fillStyle = "white";
|
||||||
canvas_context.fillRect(0,0, canvas.width, canvas.height);
|
canvas_context.fillRect(0,0, canvas.width, canvas.height);
|
||||||
paint_board(canvas, canvas_context);
|
|
||||||
};
|
|
||||||
|
|
||||||
function paint_board(canvas, canvas_context){
|
|
||||||
canvas_context.fillStyle = "grey";
|
|
||||||
for (var i=0; i < canvas.width; i += block_size + block_space){
|
|
||||||
for(var j=0; j < canvas.height; j += block_size + block_space){
|
|
||||||
canvas_context.fillRect(i, j, block_size, block_size);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const Direction = {
|
const Direction = {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user