game

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindPath

func FindPath(start, end types.Tile) []types.Tile

func GetMapGrid

func GetMapGrid() [][]types.Tile

func GetNeighbors

func GetNeighbors(tile types.Tile) []types.Tile

func GetTile

func GetTile(x, y int) types.Tile

func GetTileHeight

func GetTileHeight(x, y int) float32

func InitWorld

func InitWorld()

func RayIntersectsBox

func RayIntersectsBox(ray rl.Ray, boxMin, boxMax rl.Vector3) bool

func UpdateCamera

func UpdateCamera(camera *rl.Camera3D, player rl.Vector3, deltaTime float32)

Types

type Chat

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

func NewChat

func NewChat() *Chat

func (*Chat) AddMessage

func (c *Chat) AddMessage(playerID int32, content string)

func (*Chat) Draw

func (c *Chat) Draw(screenWidth, screenHeight int32)

func (*Chat) HandleServerMessages

func (c *Chat) HandleServerMessages(messages []*pb.ChatMessage)

func (*Chat) Update

func (c *Chat) Update() (string, bool)

type Game

type Game struct {
	Player       *types.Player
	OtherPlayers map[int32]*types.Player
	Camera       rl.Camera3D
	Models       []types.ModelAsset
	Music        rl.Music
	Chat         *Chat
	MenuOpen     bool
	QuitChan     chan struct{} // Channel to signal shutdown
	// contains filtered or unexported fields
}

func New

func New() *Game

func (*Game) Cleanup

func (g *Game) Cleanup()

func (*Game) DrawMap

func (g *Game) DrawMap()

func (*Game) DrawMenu

func (g *Game) DrawMenu()

func (*Game) DrawPlayer

func (g *Game) DrawPlayer(player *types.Player, model rl.Model)

func (*Game) GetTileAtMouse

func (g *Game) GetTileAtMouse() (types.Tile, bool)

func (*Game) HandleInput

func (g *Game) HandleInput()

func (*Game) HandleServerMessages

func (g *Game) HandleServerMessages(messages []*pb.ChatMessage)

func (*Game) LoadAssets

func (g *Game) LoadAssets() error

func (*Game) Render

func (g *Game) Render()

func (*Game) Shutdown

func (g *Game) Shutdown()

func (*Game) Update

func (g *Game) Update(deltaTime float32)

type LoginScreen

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

func NewLoginScreen

func NewLoginScreen() *LoginScreen

func (*LoginScreen) Draw

func (l *LoginScreen) Draw()

func (*LoginScreen) SetError

func (l *LoginScreen) SetError(msg string)

func (*LoginScreen) Update

func (l *LoginScreen) Update() (string, string, bool, bool)

type Node

type Node struct {
	Tile    types.Tile
	Parent  *Node
	G, H, F float32
}

Jump to

Keyboard shortcuts

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