modulepackage
0.0.0-20221006095401-aabedf80bc7f
Repository: https://github.com/nicolas1st/gosnake.git
Documentation: pkg.go.dev
# README
Snake Game In Go

Contents
Structure
-
Entry point of the game
-
board, snake, food game objects
-
Config objects and a toml config parsing function
-
Helper package for adding color to the terminal
-
Goroutines to capture user input and system calls
Installation And Running
-
Install the Go language with version found in go.mod
-
Clone the repository:
git clone github.com/Nicolas1st/goSnake
- Download the dependencies:
go mod download
- Go to the repository directory and run:
go run main.go
Controls
-
Movement
w - up
a - left
s - down
d - right
-
To quit press q
Configuration
-
Edit config.toml
-
Set the environment variable to the name of the file above,
using the following command:
On Linux:
export gosnake_config_file=config.toml
On Windows:
set gosnake_config_file=config.toml
- Run the game:
go run main.go