raycasting

package
v0.0.0-...-942270a Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ScreenWidth        = 820
	ScreenHeight       = 640
	RayLength          = 100
	RayWidth           = 1
	WallWidth          = 5
	RayCollisionRadius = 8
	ParticleRadius     = 10
)

Variables

This section is empty.

Functions

func NewVectorFromAngle

func NewVectorFromAngle(angle float64) resolv.Vector

Types

type Game

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

func NewGame

func NewGame() *Game

func (*Game) Draw

func (g *Game) Draw(screen *ebiten.Image)

func (*Game) Layout

func (g *Game) Layout(outsideWidth, outsideHeight int) (screenWidth, screenHeight int)

func (*Game) Update

func (g *Game) Update() error

type Particle

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

func NewParticle

func NewParticle(x, y float64) *Particle

type Ray

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

func NewRay

func NewRay(pos resolv.Vector, angle float64) *Ray

func (*Ray) Cast

func (r *Ray) Cast(wall *Wall) *resolv.Vector

func (*Ray) LookAt

func (r *Ray) LookAt(x, y float64)

type Wall

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

func NewWall

func NewWall(x1, y1, x2, y2 float64) *Wall

Jump to

Keyboard shortcuts

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