Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vojinovic-m/zmijica
Snake game in JavaScript implemented using functional programming principles + Supabase
https://github.com/vojinovic-m/zmijica
css functional-programming html javascript supabase
Last synced: about 2 months ago
JSON representation
Snake game in JavaScript implemented using functional programming principles + Supabase
- Host: GitHub
- URL: https://github.com/vojinovic-m/zmijica
- Owner: Vojinovic-M
- Created: 2024-11-16T15:21:10.000Z (2 months ago)
- Default Branch: main
- Last Pushed: 2024-11-26T13:53:52.000Z (about 2 months ago)
- Last Synced: 2024-11-26T14:35:55.327Z (about 2 months ago)
- Topics: css, functional-programming, html, javascript, supabase
- Language: JavaScript
- Homepage: https://zmijica.vercel.app
- Size: 16.6 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Snake Game
This is a Snake game implemented in JavaScript. The game features a simple UI, a scoreboard, and a leaderboard that stores top scores using Supabase as the backend.
## Table of Contents
- [Getting Started](#getting-started)
- [Game Rules](#game-rules)
- [Project Structure](#project-structure)
- [Dependencies](#dependencies)
- [Running the Game](#running-the-game)
- [Contributing](#contributing)
- [License](#license)## Getting Started
To get a copy of this project up and running on your local machine for development and testing, follow these steps.
### Prerequisites
- Node.js (v14.x or higher recommended)
- npm (v6.x or higher recommended)### Installation
1. Clone the repository
```sh
git clone https://github.com/your-username/snake-game.git
```2. Navigate to the project directory
```sh
cd snake-game
```3. Install the dependencies
```sh
npm install
```## Game Rules
- Use the arrow keys to control the direction of the snake.
- Eat the food to grow and increase your score.
- Avoid colliding with the walls or the snake's own body.
- When the game is over, you can enter your name to save your score to the leaderboard.## Project Structure
├── css
│└── styles.css // Styling for the game UI
├── js
│ ├── entities.js // Game entities definitions
│ ├── input.js // Input handling
│ ├── leaderboard.js // Leaderboard functionality
│ ├── logic.js // Game logic
│ ├── main.js // Main game loop
│ ├── render.js // Rendering functions
│ └── state.js // Game state definitions
├── index.html // Main HTML file
├── package.json // Project dependencies and scripts
└── README.md## Dependencies
This project uses the following main dependencies:
- [@supabase/supabase-js](https://github.com/supabase/supabase-js) - A JavaScript client for Supabase.
## Running the Game
To run the game locally:
1. Start a local server:
```sh
npm start
```2. Open your web browser and navigate to:
```
http://localhost:8080
```## Contributing
Contributions are welcome! Please open an issue or submit a pull request if you have any suggestions or improvements.