Documentation
¶
Index ¶
- type LightSource
- type Map
- type NPC
- type NPCType
- type Player
- func (p *Player) MoveBackward(deltaTime float64, worldMap *Map)
- func (p *Player) MoveForward(deltaTime float64, worldMap *Map)
- func (p *Player) RotateLeft(deltaTime float64)
- func (p *Player) RotateRight(deltaTime float64)
- func (p *Player) StrafeLeft(deltaTime float64, worldMap *Map)
- func (p *Player) StrafeRight(deltaTime float64, worldMap *Map)
- type Projectile
- type ProjectileManager
- type ProjectileType
- type Vector
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LightSource ¶
type LightSource struct {
Position Vector
Radius float64
Intensity float64
Color [3]float64 // RGB values 0-1
}
func (LightSource) GetLightingAt ¶
func (ls LightSource) GetLightingAt(pos Vector) float64
type NPC ¶
type NPC struct {
Position Vector
Direction Vector
Speed float64
MovementTimer float64 // Time until next direction change
NPCType NPCType
}
NPC represents a non-player character in the game world
type Player ¶
type Player struct {
Position Vector
Direction Vector
CameraPlane Vector
MoveSpeed float64
RotSpeed float64
}
func (*Player) MoveBackward ¶
func (*Player) MoveForward ¶
func (*Player) RotateLeft ¶
func (*Player) RotateRight ¶
func (*Player) StrafeLeft ¶
func (*Player) StrafeRight ¶
type Projectile ¶
type Projectile struct {
Position Vector
Direction Vector
Speed float64
Life float64 // Time to live in seconds
MaxLife float64
Active bool
Type ProjectileType
}
func NewFireball ¶
func NewFireball(startPos, direction Vector) *Projectile
func (*Projectile) GetLightIntensity ¶
func (p *Projectile) GetLightIntensity() float64
func (*Projectile) GetLightRadius ¶
func (p *Projectile) GetLightRadius() float64
func (*Projectile) Update ¶
func (p *Projectile) Update(deltaTime float64, worldMap *Map)
type ProjectileManager ¶
type ProjectileManager struct {
Projectiles []*Projectile
}
func NewProjectileManager ¶
func NewProjectileManager() *ProjectileManager
func (*ProjectileManager) AddProjectile ¶
func (pm *ProjectileManager) AddProjectile(p *Projectile)
func (*ProjectileManager) GetActiveLights ¶
func (pm *ProjectileManager) GetActiveLights() []LightSource
func (*ProjectileManager) Update ¶
func (pm *ProjectileManager) Update(deltaTime float64, worldMap *Map)
Click to show internal directories.
Click to hide internal directories.