game

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2023 License: Apache-2.0 Imports: 18 Imported by: 0

README

Game

Putting tests in here makes it so the GitHub Action fails. Ebiten can't start in the test runner they have.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EbitenGame

type EbitenGame struct {
	// contains filtered or unexported fields
}

func NewGame

func NewGame(init GameInitStruct) *EbitenGame

func (*EbitenGame) Draw

func (g *EbitenGame) Draw(screen *ebiten.Image)

func (*EbitenGame) GetNextSpriteID

func (g *EbitenGame) GetNextSpriteID() int

func (*EbitenGame) GetSpriteCmdChannel

func (g *EbitenGame) GetSpriteCmdChannel() chan any

func (*EbitenGame) Layout

func (g *EbitenGame) Layout(outsideWidth, outsideHeight int) (int, int)

func (*EbitenGame) PressedUserInput

func (g *EbitenGame) PressedUserInput() *models.UserInput

func (*EbitenGame) RunGame

func (g *EbitenGame) RunGame()

This function will not return. It must be run on the main thread.

func (*EbitenGame) TellGameToExit

func (g *EbitenGame) TellGameToExit()

func (*EbitenGame) Update

func (g *EbitenGame) Update() error

type GameInitStruct

type GameInitStruct struct {
	Width             int
	Height            int
	ShowFPS           bool
	JustPressedBroker *tools.Broker[*models.UserInput]
}

type SavedControlState

type SavedControlState struct {
	// contains filtered or unexported fields
}

func (*SavedControlState) GetUserInput

func (s *SavedControlState) GetUserInput(screenWidth, screenHeight int) (pressed, justPressed *models.UserInput)

Generate a new struct for pressed and just pressed. then it becomes read only to everyone else.

Jump to

Keyboard shortcuts

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