mainmenu

package
v0.2.71 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2020 License: MIT Imports: 20 Imported by: 0

Documentation

Overview

Package mainmenu handles the Termacade main menu.

Index

Constants

This section is empty.

Variables

View Source
var Options = []*Option{
	{
		Game: arcade.FlowerJourney,
		Name: "Flower Journey",
		Func: func(ctx context.Context) error {
			return runGame(ctx, flowerjourney.New(arcade.DefaultFlowerJourneyRules))
		},
		Neon: neonFJ,
	},
	{
		Game: arcade.MiteKnight,
		Name: "Mite Knight",
		Func: func(ctx context.Context) error {
			return runGame(ctx, miteknight.New(arcade.DefaultMiteKnightRules))
		},
		Neon: neonMK,
	},
	{
		Name: "High Scores",
		Func: func(ctx context.Context) error {
			var hs highscores.HighScores

			return hs.Run(ctx)
		},
		Action: "Press " + sprites.Button(arcade.BtnConfirm) + " to view!",
		Neon:   neonHS,
	},
}

Options are the default Termacade main menu options.

Functions

func RenderNeon

func RenderNeon(cam *gfx.Camera, defs ...*Neon)

RenderNeon draws a neon sign to the screen.

Types

type MainMenu struct {
	CRT       crt.CRT
	Camera    gfx.Camera
	Selection int

	LastSelectionChange time.Time
	// contains filtered or unexported fields
}

MainMenu is the Termacade main menu.

func (mm *MainMenu) Run(ctx context.Context) error

Run runs the Termacade main menu.

type Neon

type Neon struct {
	Rate    time.Duration
	Frames  int
	Toggle  []int
	Index   []int
	Sprite  []*sprites.Sprite
	X, Y, Z []float32
	FlipX   []bool
	Scale   float32
}

Neon is a declarative format for flashing neon signs.

type Option

type Option struct {
	Game   arcade.Game
	Name   string
	Func   func(ctx context.Context) error
	Neon   []*Neon
	Action string
}

Option is a Termacade main menu option.

Jump to

Keyboard shortcuts

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