1
0
Fork 0

Initial commit

This commit is contained in:
Ethanell 2021-03-11 09:39:52 +01:00 committed by flifloo
parent 178c5b5964
commit f9b86b3dab
7 changed files with 54 additions and 0 deletions

2
.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
# Jetbrain stuff
.idea

18
index.html Normal file
View file

@ -0,0 +1,18 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>KyFlo Snake</title>
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css">
<link rel="stylesheet" type="text/css" href="sources/css/style.css">
</head>
<body>
<h1>KyFlo Snake</h1>
<canvas></canvas>
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/js/materialize.min.js"></script>
<script type="module" src="sources/js/index.js"></script>
</body>
</html>

17
sources/css/style.css Normal file
View file

@ -0,0 +1,17 @@
@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');
body{
height: 100%;
width: 100%;
margin: 0;
padding: 0;
background-image: url("../images/yargon-kerman-webp-net-gifmaker-39.gif");
background-repeat: no-repeat;
background-size: 100%;
}
h1{
font-family: 'Press Start 2P', cursive;
text-align: center;
color: yellow;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 MiB

5
sources/js/Game.js Normal file
View file

@ -0,0 +1,5 @@
export class Game {
constructor(options) {
}
}

6
sources/js/Snake.js Normal file
View file

@ -0,0 +1,6 @@
class Snake {
constructor(startPos = [0,0], size = 4) {
this.size = size;
this.body = [startPos, startPos*size]
}
}

6
sources/js/index.js Normal file
View file

@ -0,0 +1,6 @@
import { Game } from "/sources/js/Game"
document.addEventListener('DOMContentLoaded', function() {
M.AutoInit();
});