Add files via upload

This commit is contained in:
Brad Stein 2018-01-02 16:28:42 -06:00 committed by GitHub
parent 2e46e95839
commit c1849faf1c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 14 deletions

View File

@ -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;
} }
} }

View File

@ -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>

View File

@ -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 = {