Skip to content

Instantly share code, notes, and snippets.

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
<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
<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 totalAxCell = boardSize / gridSize
const boardCtx = init(board, boardSize) // get canvas context
<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>
<head>
<style>
#board {
position: absolute;
z-index: 0;
}
#apple-burst-effect {
position: absolute;
z-index: 1;
  • setup prettier
  • setup project structure
    • src
    • routes
    • components
    • hocs
    • utils
    • layouts
    • lang
  • constants
const availableSteps = [1, 4, 5]
function findTotalAvailablePath(prevStep, n) {
let totalPath = 0
availableSteps.map((step) => {
const nextStep = step + prevStep
if (nextStep === n) {
totalPath++
} else if (nextStep < n) {
totalPath += findTotalAvailablePath(nextStep, n)
@abzeede
abzeede / jsconfig.json
Created August 7, 2019 07:50
setup vscode for relative path goto
{
// This file is required for VSCode to understand webpack aliases
"compilerOptions": {
// This must be specified if "paths" is set
"baseUrl": ".",
// Relative to "baseUrl"
"paths": {
"@/*": ["./src/*"],
}
}
// inital app
const app = new PIXI.Application({
width: window.innerWidth, // set app width
height: window.innerHeight, // set app height
antialias: true,
transparent: false,
resolution: 1
});
// make background green