game

package
v0.0.0-...-5e13618 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	StateIdle       = 0
	StateStarting   = 1
	StateRunning    = 2
	StateRestarting = 3
)
View Source
const (
	MaxPlayers    = 10
	NeededPlayers = 3
	StartTimer    = 30
	RestartTimer  = 10
)
View Source
const (
	TypeMessage = 0
	TypePopup   = 1
	TypeTitle   = 2
)

Variables

This section is empty.

Functions

This section is empty.

Types

type PlayerHandler

type PlayerHandler struct {
	player.NopHandler
	// contains filtered or unexported fields
}

PlayerHandler ...

func NewPlayerHandler

func NewPlayerHandler(game *TNTRun, player *player.Player) *PlayerHandler

NewPlayerHandler ...

func (*PlayerHandler) HandleBlockBreak

func (h *PlayerHandler) HandleBlockBreak(ctx *event.Context, _ cube.Pos, _ *[]item.Stack)

HandleBlockBreak ...

func (*PlayerHandler) HandleBlockPlace

func (h *PlayerHandler) HandleBlockPlace(ctx *event.Context, _ cube.Pos, _ world.Block)

HandleBlockPlace ...

func (*PlayerHandler) HandleFoodLoss

func (h *PlayerHandler) HandleFoodLoss(ctx *event.Context, _ int, _ int)

HandleFoodLoss ...

func (*PlayerHandler) HandleHurt

func (h *PlayerHandler) HandleHurt(ctx *event.Context, _ *float64, _ *time.Duration, src world.DamageSource)

HandleHurt ...

func (*PlayerHandler) HandleMove

func (h *PlayerHandler) HandleMove(_ *event.Context, _ mgl64.Vec3, _ float64, _ float64)

HandleMove ...

func (*PlayerHandler) HandleQuit

func (h *PlayerHandler) HandleQuit()

HandleQuit ...

type TNTRun

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

TNTRun ...

func NewTNTRun

func NewTNTRun(srv *server.Server) *TNTRun

NewTNTRun ...

func (*TNTRun) AddSpectator

func (t *TNTRun) AddSpectator(player *player.Player)

AddSpectator ...

func (*TNTRun) BroadcastMessage

func (t *TNTRun) BroadcastMessage(msg string, msgType int)

BroadcastMessage ...

func (*TNTRun) CheckWinner

func (t *TNTRun) CheckWinner()

CheckWinner ...

func (*TNTRun) IsPlayer

func (t *TNTRun) IsPlayer(player *player.Player) bool

IsPlayer ...

func (*TNTRun) OnJoin

func (t *TNTRun) OnJoin(p *player.Player)

OnJoin ...

func (*TNTRun) RemovePlayer

func (t *TNTRun) RemovePlayer(player *player.Player)

RemovePlayer ...

type TNTRunTask

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

TNTRunTask ...

func NewTNTRunTask

func NewTNTRunTask(game *TNTRun) *TNTRunTask

NewTNTRunTask ...

func (*TNTRunTask) Start

func (t *TNTRunTask) Start()

Start ...

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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