|
1 |
| -# my-snake-game |
2 |
| -JS snake game (just for fun) |
| 1 | +# My Snake Game |
| 2 | + |
| 3 | +A classic Snake game implemented in JavaScript, providing a nostalgic trip with a modern twist. Use your keyboard or on-screen arrows to control the snake, and compete for high scores! |
| 4 | + |
| 5 | +## Game Instructions |
| 6 | + |
| 7 | +- **Movement**: Use the arrow keys `←`, `↑`, `↓`, `→` to control the snake's direction. For mobile or touch devices, use the on-screen arrows. |
| 8 | +- **Start Game**: Press the spacebar or use the Start button to begin the game. |
| 9 | +- **View Scores**: Click on "See scores" to check the latest 10 scores displayed on the top right corner of the game screen. |
| 10 | +- **Scores**: High scores and the current score are displayed on the top left corner during gameplay. |
| 11 | + |
| 12 | +## Getting Started |
| 13 | + |
| 14 | +To set up the game for development or build it for production, you'll need to have [Node.js](https://nodejs.org/en/) installed. Then, follow these instructions: |
| 15 | + |
| 16 | +1. Clone the repository: |
| 17 | + |
| 18 | +```bash |
| 19 | +git clone git@github.com:vianch/my-snake-game.git |
| 20 | +cd my-snake-game |
| 21 | +``` |
| 22 | + |
| 23 | +2. Install dependencies: |
| 24 | + |
| 25 | +```bash |
| 26 | +yarn install |
| 27 | +``` |
| 28 | + |
| 29 | +3. To start the development server: |
| 30 | + |
| 31 | +```bash |
| 32 | +yarn run dev |
| 33 | +``` |
| 34 | + |
| 35 | +4. To build for production: |
| 36 | + |
| 37 | +```bash |
| 38 | +yarn run build |
| 39 | +``` |
| 40 | + |
| 41 | +## Development Scripts |
| 42 | + |
| 43 | +- `build`: Bundles the application and minifies JavaScript, CSS, and HTML for production. |
| 44 | +- `build:prod`: Bundles and minifies JavaScript for production with browser-specific targets. |
| 45 | +- `build:dev`: Development build that watches for changes. |
| 46 | +- `dev`: Starts the development server with live reloading. |
| 47 | +- `init`: Cleans any previous builds and reinstalls dependencies before a fresh build. |
| 48 | +- `lint:style`: Runs StyleLint with autocorrection when possible. |
| 49 | +- `lint:formatting`: Runs Prettier to format the code. |
| 50 | +- `lint`: Runs both linting scripts for styles and formatting. |
| 51 | +- `minify:html`: Minifies the HTML file for production. |
| 52 | +- `minify:css`: Minifies the CSS file for production. |
| 53 | +- `start`: Runs the default setup script. |
| 54 | +- `start:dev`: Starts the development server with source maps and live reloading. |
| 55 | + |
| 56 | +**Note:** To execute any of these scripts, use `yarn run <script-name>` replacing `<script-name>` with the desired script. |
| 57 | + |
| 58 | +## Dependencies |
| 59 | + |
| 60 | +Below is a list of development and production dependencies for this project: |
| 61 | + |
| 62 | +### Development Dependencies |
| 63 | + |
| 64 | +- *esbuild*: A fast bundler and minifier. |
| 65 | +- *eslint*: Pluggable JavaScript linter. |
| 66 | +- *eslint-config-airbnb-base*, *eslint-config-prettier*: ESLint configurations for coding standards and to disable style rules that conflict with Prettier. |
| 67 | +- *eslint-plugin-import*, *eslint-plugin-prettier*: ESLint plugins for managing imports and integrating Prettier. |
| 68 | +- *clean-css-cli*: Command-line interface for minifying CSS files. |
| 69 | +- *html-minifier*: Minifies HTML files. |
| 70 | +- *husky*: A tool for using git hooks. |
| 71 | +- *prettier*: Code formatter. |
| 72 | + |
| 73 | +### Production Dependencies |
| 74 | + |
| 75 | +- *@supabase/supabase-js*: JavaScript client for interacting with Supabase APIs. |
| 76 | + |
| 77 | +## Author |
| 78 | + |
| 79 | +- Victor Chavarro - <info@vianch.com> |
| 80 | + |
| 81 | +## License |
| 82 | + |
| 83 | +This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. |
0 commit comments