mainmenu

package
v0.2.67 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2020 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Options = []*Option{
	{
		Game: arcade.FlowerJourney,
		Name: "Flower Journey",
		Func: func(ctx context.Context) error {
			_, err := game.RunGame(ctx, flowerjourney.New(arcade.DefaultFlowerJourneyRules), getSeed())

			return err
		},
		Neon: neonFJ,
	},
	{
		Game: arcade.MiteKnight,
		Name: "Mite Knight",
		Func: func(ctx context.Context) error {
			_, err := game.RunGame(ctx, miteknight.New(arcade.DefaultMiteKnightRules), getSeed())

			return err
		},
		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,
	},
}

Functions

func RenderNeon

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

Types

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

	LastSelectionChange time.Time
}
func (mm *MainMenu) MoveSelection(direction int)
func (mm *MainMenu) Render()
func (mm *MainMenu) Run(ctx context.Context) error

type Neon

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

type Option

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

Jump to

Keyboard shortcuts

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