gopher-garden

module
v0.0.0-...-09bd2b9 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2020 License: BSD-3-Clause

README

Gopher-Garden

Overview:

Go Report Card License

Play as Garry the Gopher and collect as many carrots as you can whilst avoiding the evil overlords of the garden: the snakes!
Gopher-Garden is a 2D game in which you control Garry the Gopher who moves around a garden and who's goal is to eat as many carrots as he can whilst avoiding deadly snakes which are in constant roam around the garden.
  • Gopher-Garden is written entirely in Go 1.14 and uses Gio, a portable immediate mode GUI implemented in Go and developed by Elias Naur, for graphics and user-input.

  • Gopher-Garden will save all highscores and the user-names that correspond to them in a local file who's data can be viewed through the in-game menu. Do not edit the highscores.txt file because it can erroneate the parsing and cause the program to panic.

Game Controls:

Text Fields:
  • At the start of every new round, the user will be prompted to enter their name.
    • This name will determine the name assigned to the score they achieve in that game. If their name is not already stored with a highscore in the local file, that name and score pair will be stored in the file and any later scores higher than that score with the same name will update the highscore for that user.
Key Presses:

Note: w-a-s-d or the arrow keys may be used to move Garry.

  • '↑' or 'w' -> Move Garry up.

  • '←' or 'a' -> Move Garry left.

  • '↓' or 's' -> Move Garry down.

  • '→' or 'd' -> Move Garry right.

  • 'Space' or 'e' -> Move Garry into a gopher hole.

    When Garry moves into a gopher hole he will pop out at a random one of the other gopher holes. Garry can only move into a gopher hole if his last move was not a gopher hole move.

Buttons:
  • 'Menu' -> On click this button will take you from your current game round into the menu and pause your current game round. Note: If you access the menu in the middle of your game round and you do not resume to that game, your score for that game will NOT be recorded. The menu button can be accessed at all times. When you die however, the continue button acts as an alternative to the menu button which saves your game data.

    (The following buttons can only be accessed while in the menu.)

    • 'New Game' -> On click this button will start a new round of the game.
    • 'Back' -> On click this button will take you back into the game round from the menu.
    • 'Highscores' -> On click this button will show the top 5 locally saved highscores and the players who achieved them.
      • The highscores view screen can be exited back into the menu by clicking the Back button in the top right of the highscores tab. Note that this back button is different from the menu back button.
    • 'Exit' -> On click this button will terminate the current game session.
  • 'Continue' -> On click this button will take you to the menu and save your score of the game with the name you entered at the beginning of the round. This button is only accessible once you die as an alternative to menu, however pressing menu and not pressing continue will not save your data to the local highscores file.

Installation:

For a complete installation of Gopher-Garden, please perform the following steps.

  • If the latest version of Go is not already installed on your machine, please follow the system-specific instructions to do so here.

  • Once the latest version of Go is installed, please install the system-specific dependencies to run Gio applications here.

  • Once these preliminary steps are complete, Gopher-Garden can be installed. It would be simpler to use modules and have go run the main package remotely hosted, however because highscores are saved in a local file, this is not an option. To install Gopher-Garden it is necessary to install the repository on your local machine and this can be done via cloning the repository or downloading the code.

  • Once you have a local copy of the repository, move into the 'gopher-garden/main' directory, and run the following command.

go run main.go

Following these steps should allow you to run the game, however if you come across any issues, feel free to notify me through github.

CREDITS:

This game is based off of the Go gopher which was designed by Renée French and is licensed under Creative Commons Attribution 3.0.

A detailed list of image credits can be found in CREDITS.

LICENSE:

Gopher-Garden is licensed under BSD-3-Clause License. For more information see LICENSE.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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