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 installAlready 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
