game

package
v0.0.0-...-36a93ca Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2025 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const SectorSize = 512

Variables

This section is empty.

Functions

func ApplyInput

func ApplyInput(e *Entity, input InputPacket, deltaTime float32)

func EncodeDeltaSnapshot

func EncodeDeltaSnapshot(writer *pulsenet.BitWriter, entities []Entity, lastState map[uint32]SnapshotEntry)

func WriteVarInt

func WriteVarInt(writer *pulsenet.BitWriter, value uint32)

Types

type Entity

type Entity struct {
	ID         uint32
	PosX, PosY float32
	VelX, VelY float32
	Rotation   float32
	AngularVel float32
}

func QueryInterest

func QueryInterest(centerX, centerY float32, world map[SectorCoord][]Entity) []Entity

type InputPacket

type InputPacket struct {
	Sequence  uint16
	Timestamp uint32
	Flags     uint8
	TurnDir   int8
}

type SectorCoord

type SectorCoord struct {
	X, Y int
}

func GetSector

func GetSector(x, y float32) SectorCoord

type SnapshotEntry

type SnapshotEntry struct {
	ID         uint32
	PosX, PosY uint16
	VelX, VelY int16
	Rotation   uint8
	AngularVel int8
}

Source Files

  • entity.go
  • input.go
  • interest.go
  • snapshot.go

Jump to

Keyboard shortcuts

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