Skip to content

Instantly share code, notes, and snippets.

  • setup prettier
  • setup project structure
    • src
    • routes
    • components
    • hocs
    • utils
    • layouts
    • lang
  • constants
<html>
<head>
<style>
#board {
position: absolute;
z-index: 0;
}
#apple-burst-effect {
position: absolute;
z-index: 1;
<html>
<body>
<canvas id="apple-burst-effect"></canvas>
</body>
<script>
const MAXIMUM_BURST_SIZE = 6
const GRID_SIZE = 10
const BOARD_SIZE = 300
const TOTAL_AX_CELL = BOARD_SIZE / GRID_SIZE
<html>
<body>
<canvas id="board"></canvas>
</body>
<script>
const board = document.getElementById("board")
const boardSize = 300 // game space size
const gridSize = 10 // size for snake body, apple
const totalAxCell = boardSize / gridSize
const boardCtx = init(board, boardSize) // get canvas context
<html>
<body>
<canvas id="board"></canvas>
</body>
<script>
const board = document.getElementById("board")
const boardSize = 300 // game space size
const gridSize = 10 // size for snake body, apple
const totalAxCell = boardSize / gridSize
<html>
<body>
<canvas id="board"></canvas>
</body>
<script>
const board = document.getElementById("board")
const boardSize = 300 // game space size
const gridSize = 10 // size for snake body, apple
const boardCtx = init(board, boardSize) // get canvas context
let snakeSize = 5 // initial size of snake
cache:
directories:
- node_modules # cache node_module
language: node_js # set language to node_js
node_js:
7 # use node version 7
branches:
only:
- master # auto build and deploy in only master branch
script: # run after installed