scenes

package
v0.0.0-...-219ab8e Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Zoom is the zoom scale of the game viewport.
	Zoom = 1.0
	// InterpolationOffset is how far back in time we want to interpolate.
	InterpolationOffset = 150 // ms - currently 3x the server tick rate (50ms)
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthScene

type AuthScene struct {
	*BaseScene
	// contains filtered or unexported fields
}

func (*AuthScene) Draw

func (s *AuthScene) Draw(screen *ebiten.Image)

func (*AuthScene) Init

func (s *AuthScene) Init() error

func (*AuthScene) Update

func (s *AuthScene) Update() error

type AuthSceneOptions

type AuthSceneOptions struct {
	OnLogin    func(email, password string) error
	OnRegister func(email, password string) error
}

type BaseScene

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

func NewBaseScene

func NewBaseScene(root objects.GameObject) *BaseScene

func (*BaseScene) Destroy

func (s *BaseScene) Destroy() error

func (*BaseScene) Draw

func (s *BaseScene) Draw(screen *ebiten.Image)

func (*BaseScene) GetRoot

func (s *BaseScene) GetRoot() objects.GameObject

func (*BaseScene) Init

func (s *BaseScene) Init() error

func (*BaseScene) Update

func (s *BaseScene) Update() error

type CameraViewport

type CameraViewport struct {
	X int
	Y int
}

type CharacterSelectionScene

type CharacterSelectionScene struct {
	*BaseScene
	// contains filtered or unexported fields
}

func (*CharacterSelectionScene) Draw

func (s *CharacterSelectionScene) Draw(screen *ebiten.Image)

func (*CharacterSelectionScene) Init

func (s *CharacterSelectionScene) Init() error

func (*CharacterSelectionScene) Update

func (s *CharacterSelectionScene) Update() error

type CharacterSelectionSceneOpts

type CharacterSelectionSceneOpts struct {
	// FetchCharacters is a function that fetches the characters that the user can select from.
	FetchCharacters func() ([]*models.Character, error)
	// CreateCharacter is a function that creates a new character.
	CreateCharacter func(name string) (*models.Character, error)
	// DeleteCharacter is a function that deletes a character.
	DeleteCharacter func(characterID int32) error
	// OnSelectCharacter is a callback that is called when a character is selected.
	OnSelectCharacter func(characterID int32) error
}

type ErrorScene

type ErrorScene struct {
	*BaseScene
}

type GameOverScene

type GameOverScene struct {
	*BaseScene
}

type GameScene

type GameScene struct {
	*BaseScene
	// contains filtered or unexported fields
}

func (*GameScene) Draw

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

func (*GameScene) Init

func (g *GameScene) Init() error

func (*GameScene) Update

func (g *GameScene) Update() error

type Scene

type Scene interface {
	objects.Lifecycle

	// Scene specific methods
	GetRoot() objects.GameObject
}

func NewAuthScene

func NewAuthScene(opts AuthSceneOptions) (Scene, error)

func NewCharacterSelectionScene

func NewCharacterSelectionScene(opts CharacterSelectionSceneOpts) (Scene, error)

func NewErrorScene

func NewErrorScene(msg string) (Scene, error)

func NewGameOverScene

func NewGameOverScene() (Scene, error)

func NewGameScene

func NewGameScene(networkManager *network.NetworkManager) (Scene, error)

type ServerNPCUpdateBuffer

type ServerNPCUpdateBuffer struct {
	LastStateReceived int64
	States            []*messages.ServerNPCUpdate
}

type ServerPlayerUpdateBuffer

type ServerPlayerUpdateBuffer struct {
	LastUpdateReceived int64
	Updates            []*messages.ServerPlayerUpdate
}

Jump to

Keyboard shortcuts

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