pages

package
v0.0.0-...-def37d1 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TERMWIDTH  int = 80
	TERMHEIGHT int = 24
)

TERMWIDTH is the minimum terminal width allowed to play TERMHEIGHT is the minimum terminal height allowed to play

Variables

This section is empty.

Functions

func DrawOptions

func DrawOptions(keyPressed chan termbox.Key, gameOptions *game.Options, selectedOption string) bool

DrawOptions handles the options page shown before the game starts

func DrawSmallTerminal

func DrawSmallTerminal(termWidth, termHeight int)

DrawSmallTerminal shows a warning that tells the player that the terminal is too small

func DrawWelcome

func DrawWelcome()

DrawWelcome draws the initial page of the game

func Play

func Play(keyPressed chan termbox.Key, options game.Options)

Play handles the play page of the game

Types

type Page

type Page uint8

Page is the type that reppresents the terminal page

const (
	WELCOME       Page = 0
	TERMINALSMALL Page = 1
	OPTIONS       Page = 2
	GAME          Page = 3
)

WELCOME is the welcoming page TERMINALSMALL is the page that notifies the user that the terminal size is too small OPTIONS is the page that contains the game options GAME is the game page

Jump to

Keyboard shortcuts

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