Skip to content

aparajita31pandey/snakeGame

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Snake Game

This is a simple implementation of the classic Snake game in Go using the github.com/gdamore/tcell package for terminal-based graphics. How to Run

To run the game, make sure you have Go installed on your system. Then, follow these steps:

  1. Clone the repository to your local machine.
  2. Navigate to the project directory.
  3. Run the following command to build and execute the game: go run main.go
  4. Use arrow keys to control the direction.

Gameplay

  • Use the arrow keys to control the movement of the snake.
  • The game starts in the NOT STARTED state. Press the arrow keys to select the game mode and start the game.
  • The objective is to guide the snake to eat the food and grow in length without colliding with the walls or itself.
  • The game ends when the snake collides with the walls or itself, displaying "GAME OVER" on the screen. Code Structure

The main game logic is implemented in the main.go file, which includes the game initialization, event handling, screen updates, and game over conditions. Dependencies

  • This game relies on the github.com/gdamore/tcell package for terminal-based graphics and user input handling.

Game Snippet

img_1.png

img.png

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages