Categorygithub.com/Nicolas1st/goSnake
modulepackage
0.0.0-20221006095401-aabedf80bc7f
Repository: https://github.com/nicolas1st/gosnake.git
Documentation: pkg.go.dev

# README

Snake Game In Go

gif with gameplay

Contents

Structure

  • main.go

    Entry point of the game

  • objects

    board, snake, food game objects

  • config

    Config objects and a toml config parsing function

  • color

    Helper package for adding color to the terminal

  • routines

    Goroutines to capture user input and system calls

Installation And Running

  1. Install the Go language with version found in go.mod

  2. Clone the repository:

git clone github.com/Nicolas1st/goSnake
  1. Download the dependencies:
go mod download
  1. 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

  1. Edit config.toml

  2. 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
  1. Run the game:
go run main.go

# Packages

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author