A classic Snake game built with SvelteKit and integrated with the AT Protocol for user authentication.
- Classic Snake Gameplay: Enjoy the timeless game of Snake.
- AT Protocol Authentication: Log in using your AT Protocol handle (e.g.,
ewancroft.ukor*.bsky.social). - Responsive Design: Play on various devices.
- SvelteKit Frontend: Fast and modern user interface.
- High Score Saving: Automatically saves your high score to the AT Protocol.
To get a local copy up and running, follow these simple steps.
- Node.js (LTS recommended)
- npm (comes with Node.js)
-
Clone the repository:
git clone https://github.com/ewanc26/atproto-snake.git cd atproto-snake -
Install dependencies:
npm install
npm run devThis will start the development server, usually at http://localhost:5173.
npm run buildThis will create a build directory with the production-ready files.
- Login: Enter your AT Protocol handle (e.g.,
yourhandle.bsky.social), app password, and optionally your PDS URL on the login page. - Start Game: Once logged in, the game will start after a short countdown.
- Controls: Use the arrow keys (Up, Down, Left, Right) on your keyboard to control the snake. On touch devices, swipe in the desired direction.
- Objective: Guide the snake to eat the food (green squares) to grow longer and increase your score. Avoid hitting the walls or your own tail.
- Game Over: The game ends when the snake hits a wall or its own tail. Your score will be automatically submitted to the AT Protocol if it's greater than zero.
src/lib/auth/: Contains all AT Protocol authentication logic.src/lib/snake/: Core Snake game logic.src/routes/: SvelteKit routes for different pages (login, game).src/lib/components/: Reusable Svelte components.static/client-metadata.json: OAuth client metadata for AT Protocol.
- SvelteKit: Web framework for building the frontend.
- AT Protocol: Decentralised social networking protocol for authentication.
- Tailwind CSS: Utility-first CSS framework for styling.
- Vite: Next-generation frontend tooling.
This project is open-source and available under the MIT License.
If you found this useful, consider buying me a ko-fi!