https://github.com/devsazal/snake-game-angular
Snake Game - Angular v19
https://github.com/devsazal/snake-game-angular
angular frontend-web typescript
Last synced: about 2 months ago
JSON representation
Snake Game - Angular v19
- Host: GitHub
- URL: https://github.com/devsazal/snake-game-angular
- Owner: DevSazal
- License: mit
- Created: 2024-12-02T20:10:43.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-12-24T00:25:06.000Z (over 1 year ago)
- Last Synced: 2025-03-26T06:44:20.312Z (about 1 year ago)
- Topics: angular, frontend-web, typescript
- Language: TypeScript
- Homepage: https://devsazal.github.io/snake-game-angular/
- Size: 275 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Snake Game
The game was developed on angular 19.0.1.
Let's clone the repository on your machine.
The application includes the following files and folders:
```bash
# architecture
# deep drive
todo-app/
├── src/
│ ├── app/
│ │ ├── components/
│ │ │ ├── game/ # container component
│ │ │ │ ├── game.component.html
│ │ │ │ ├── game.component.css
│ │ │ │ └── game.component.ts
│ │ │ │
│ │ │ ├── playground/ # presentation component
│ │ │ │ ├── playground.component.html
│ │ │ │ ├── playground.component.css
│ │ │ │ └── playground.component.ts
│ │ │ │
│ │ ├── models/
│ │ │ ├── food.model.ts
│ │ │ └── snake.model.ts
│ │ │ │
│ │ ├── services/
│ │ │ ├── game.service.ts
│ │ │ └── score.service.ts # use localStorage
│ │ │
│ │ ├── app.component.html
│ │ ├── app.component.css
│ │ ├── app.component.ts
│ │ ├── app.config.ts
│ │ └── app.routes.ts
│ │
│ ├── styles.css
│ ├── index.html
│ └── main.ts
│
├── angular.json
├── package.json
├── tsconfig.json
└── README.md
```
## Installation and Configuration
Let's move to the cloned directory with your terminal.
To install, build, and start the application for the first time, run the following commands:
```bash
npm install
```
Already done? Cool! You are almost ready to enjoy the game ⛳️🐟🐍
### Build & Run:
To start a local development server, run:
```bash
ng serve
```
Once the server is running, open your browser and navigate to `http://localhost:4200/`
### Game Rules:
* 15 seconds timer to collect food or game over
* Game over if the snake hits the playground walls
* Game over if snake's head collides with the body
* Just move in the playground and grow by collecting food
* Keyboard control: `ArrowUp`, `ArrowDown`, `ArrowLeft`, `ArrowRight`
## 🧑💻 Stay in touch
- Author - [Sazal Ahamed](https://sazal.vercel.app)
- Linkedin - [Profie](https://www.linkedin.com/in/sazal-ahamed/)
- GitHub - [DevSazal](https://github.com/DevSazal)
## License
[MIT licensed](LICENSE) © 2024