goSnake

command module
v0.0.0-...-aabedf8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 6, 2022 License: MIT Imports: 10 Imported by: 0

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

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL