- setup prettier
- setup project structure
- src
- routes
- components
- hocs
- utils
- layouts
- lang
- constants
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <html> | |
| <head> | |
| <style> | |
| #board { | |
| position: absolute; | |
| z-index: 0; | |
| } | |
| #apple-burst-effect { | |
| position: absolute; | |
| z-index: 1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
| { | |
| // 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/*"], | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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 |
OlderNewer