game

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// ScreenWidth is the width of the screen.
	ScreenWidth = 640
	// ScreenHeight is the height of the screen.
	ScreenHeight = 480
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ConnectingState

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

ConnectingState represents the state when the game is connecting to the server.

func NewConnectingState

func NewConnectingState(game *Game) *ConnectingState

NewConnectingState creates a new ConnectingState.

type Game

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

Game represents the main game object.

func New

func New(ctx context.Context, cancel context.CancelFunc, assets *assets.Assets) (*Game, error)

New creates a new game instance.

func (*Game) Draw

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

Draw delegates the drawing logic to the current game state.

func (*Game) Layout

func (*Game) Layout(_, _ int) (int, int)

Layout returns the game's logical screen dimensions.

func (*Game) Update

func (g *Game) Update() error

Update delegates the update logic to the current game state.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳