goland

package
v0.0.0-...-2efd997 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FRAMERATE          = 61
	NUMWORKERS         = 4 // TODO
	MIDNIGHT           = 0.0
	ONETHIRTY          = math.Pi * 0.25
	THREEO             = math.Pi * 0.5
	FOURTHIRTY         = math.Pi * 0.75
	SIXO               = math.Pi * 1.0
	SEVENTHIRTY        = math.Pi * 1.25
	NINEO              = math.Pi * 1.5
	TENTHIRTY          = math.Pi * 1.75
	TWOPI              = math.Pi * 2.0
	MICRO              = 1e-6
	SHEARFACTOR        = 1.00
	WINDOWWIDTH  int32 = 1280
	WINDOWHEIGHT int32 = 960
	VELOCITY           = 0.5
	ROTVEL             = 0.075
	WALLHEIGHT         = 5.0
	FLOORHEIGHT        = -5.0
	CEILHEIGHT         = 6.5
)
View Source
const (
	End = iota
)

Variables

View Source
var RANDOMSAMPLE = make([]byte, 4096)

Functions

func DoMaze

func DoMaze(recvCh chan int, sendCh chan int, screen *Screen, game *Game)

Types

type Game

type Game struct {
	Cols, Rows int
	Grid       []bool
	Players    []*Player
}

func NewGameFromFilename

func NewGameFromFilename(filename string) (game *Game, err error)

type Player

type Player struct {
	Vector
	Velocity, RotVel float64
	Game             *Game
	Visited          []bool
}

type Point

type Point struct {
	X, Y float64
}

func LLBoundary

func LLBoundary(p Point) Point

func LRBoundary

func LRBoundary(p Point) Point

func ULBoundary

func ULBoundary(p Point) Point

func URBoundary

func URBoundary(p Point) Point

type Ray

type Ray struct {
	PixelStart int32
	Data       []byte
}

type Screen

type Screen struct {
	Width, Height, Depth int32
	HAngles, VAngles     []float64
	Window               *sdl.Window
	Renderer             *sdl.Renderer
	SurfaceTexture       *sdl.Texture
	TargetTexture        *sdl.Texture
	SegTextures          []*sdl.Texture
	Segments             []*sdl.Rect
	TargetMask           *sdl.Rect
	SegMask              *sdl.Rect
	Format               *sdl.PixelFormat
}

type Vector

type Vector struct {
	Point
	Dir float64
}

Jump to

Keyboard shortcuts

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