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:
# 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
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:
npm install
Already done? Cool! You are almost ready to enjoy the game ⛳️🐟🐍
To start a local development server, run:
ng serve
Once the server is running, open your browser and navigate to http://localhost:4200/
- 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
- Author - Sazal Ahamed
- Linkedin - Profie
- GitHub - DevSazal
MIT licensed © 2024