Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interface #4

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Snake Game

Bem vindo ao clássico jogo da cobrinha.

Como jogar?

O jogador deve mover a cobra em direção ao quadrado vermelho (maçã) utilizando as setas esquerda, direita, pra cima e pra baixo. Quando a cabeça da cobra atinge a comida, a cobra aumenta de tamanho , a comida é recolocada numa nova posição (escolhida aleatoriamente).

## Licença

[MIT](https://choosealicense.com/licenses/mit/)
8 changes: 5 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
<!DOCTYPE html>
<html>
<head>
<title>SNAKE!</title>
<title>SNAKE GAME!</title>
<link rel="icon" href="https://techviral.net/wp-content/uploads/2017/02/Now-You-Can-Play-The-Nokia-3310s-Iconic-Snake-Game-On-Facebook-Messenger.png" type="favcon"/>
</head>
<body>
<h1> Welcome to Snake Game</h1>
<canvas id="stage" width="600" height="600"></canvas>

<link rel="stylesheet" type="text/css" href="styles.css" />
<script type="text/javascript">
// TODO: Melhorar layout do jogo
// TODO: Incorporar score | botão de pausar
Expand All @@ -18,7 +20,7 @@
document.addEventListener("keydown", keyPush);
setInterval(game, 60);
// velocidade
const vel = 1;
const vel = 0.9;
// trajeto da cobrinha;
var trail = [];
// tamanho da cobra
Expand Down
19 changes: 19 additions & 0 deletions styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
@import url('http://fonts.cdnfonts.com/css/pixe-l7');

body {
background-image: linear-gradient(to right, #233329, #63D471)
}
h1 {
margin: 10px;
display: flex;
justify-content: center;
font-family: 'Thin Pixe-l7', sans-serif;

}

canvas {
display: inline-block;
justify-content: center;
padding: 20px;
margin: 20px;
}