Documentation
¶
Index ¶
- Constants
- Variables
- func DegToRad(angle float64) float64
- func DrawMap(screen *ebiten.Image, currentMap *Map)
- func DrawSubSector(screen *ebiten.Image, subSector SubSector, segs []Seg, vertexes []Vertex, ...)
- func IsPlayerLeftOfSplitter(playerX float32, playerY float32, node Node, offsetX float32, offsetY float32) bool
- func LoadWadFile(path string)
- func RadToDeg(angle float64) float64
- func ReadLumpData(directory Directory) []byte
- func Traverse(nodeId int16, currentMap *Map, x float32, y float32, screen *ebiten.Image)
- type BoundingBox
- type Directory
- type Linedef
- type Map
- type Node
- type Sector
- type Seg
- type SubSector
- type Thing
- type Vec2
- type Vertex
- type WadHeader
Constants ¶
View Source
const ( NativeResX = 320 NativeResY = 200 ScaleFactor = 5 ScreenResX = NativeResX * ScaleFactor ScreenRexY = NativeResY * ScaleFactor ScreenCenterX = ScreenResX / 2 ScreenCenterY = ScreenRexY / 2 FieldOfView = 90 HalfFieldOfView = FieldOfView / 2 )
View Source
const ( PlayerRotationSpeed float64 = 2 PlayerMovementSpeed float64 = 2 )
View Source
const ( ThingsOffset int = 1 LineDefsOffset int = 2 SideDefsOffset int = 3 VertexesOffset int = 4 SegsOffset int = 5 SubSectorOffset int = 6 NodesOffset int = 7 SectorsOffset int = 8 RejectOffset int = 9 BlockmapOffset int = 10 )
Index offsets between Map-marker and Map-objects
View Source
const ( ThingsBlockSize int32 = 10 DirectoryBlockSize int32 = 16 VertexesBlockSize int32 = 4 LinedefsBlockSize int32 = 14 SegsBlockSize int32 = 12 SubSectorBlockSize int32 = 4 NodeBlockSize int32 = 28 SectorBlockSize int32 = 24 )
Block sizes (in bytes)
Variables ¶
View Source
var DrawBoundingBoxesInMap bool = false
View Source
var PlayerAngle float64 = 180
View Source
var PlayerOffsetX float32 = 0
only for testing
View Source
var PlayerOffsetY float32 = 0
Functions ¶
func DrawSubSector ¶
func IsPlayerLeftOfSplitter ¶
func LoadWadFile ¶
func LoadWadFile(path string)
func ReadLumpData ¶
Types ¶
type BoundingBox ¶
type BoundingBox struct {
// contains filtered or unexported fields
}
func ConvertToBoundingBox ¶
func ConvertToBoundingBox(data int64) BoundingBox
ConvertToBoundingBox converts data given as a 64-bit integer from the WAD file to the BoundingBox data structure.
type Directory ¶
type Directory struct {
// contains filtered or unexported fields
}
type Map ¶
type Map struct { Name string Things []Thing Linedefs []Linedef Vertexes []Vertex Segs []Seg SubSectors []SubSector Nodes []Node Sectors []Sector }
func ReadMapData ¶
type Node ¶
type Node struct {
// contains filtered or unexported fields
}
Node see: https://doom.fandom.com/wiki/Node
type Sector ¶
type Sector struct {
// contains filtered or unexported fields
}
Sector see: https://doom.fandom.com/wiki/Sector
type Seg ¶
type Seg struct {
// contains filtered or unexported fields
}
Seg see: https://doom.fandom.com/wiki/Seg
type SubSector ¶
type SubSector struct {
// contains filtered or unexported fields
}
SubSector see: https://doom.fandom.com/wiki/Subsector
type Thing ¶
Thing (see: https://doomwiki.org/wiki/Thing)
Click to show internal directories.
Click to hide internal directories.