model

package
v0.0.0-...-6dfeff5 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Crosshairs

type Crosshairs struct {
	*Sprite

	HitIndicator *Crosshairs
	// contains filtered or unexported fields
}

func NewCrosshairs

func NewCrosshairs(
	x, y, scale float64, img *ebiten.Image, columns, rows, crosshairIndex, hitIndex int,
) *Crosshairs

func (*Crosshairs) ActivateHitIndicator

func (c *Crosshairs) ActivateHitIndicator(hitTime int)

func (*Crosshairs) IsHitIndicatorActive

func (c *Crosshairs) IsHitIndicatorActive() bool

func (*Crosshairs) Update

func (c *Crosshairs) Update()

type Effect

type Effect struct {
	*Sprite
	LoopCount int
}

func NewAnimatedEffect

func NewAnimatedEffect(
	x, y, scale float64, animationRate int, img *ebiten.Image, columns, rows int, anchor raycaster.SpriteAnchor, loopCount int,
) *Effect

type Entity

type Entity struct {
	Position        *geom.Vector2
	PositionZ       float64
	Scale           float64
	Anchor          raycaster.SpriteAnchor
	Angle           float64
	Pitch           float64
	Velocity        float64
	CollisionRadius float64
	CollisionHeight float64
	MapColor        color.RGBA
	Parent          *Entity
}

func (*Entity) Pos

func (e *Entity) Pos() *geom.Vector2

func (*Entity) PosZ

func (e *Entity) PosZ() float64

type Map

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

func NewMap

func NewMap() *Map

func (*Map) GetCollisionLines

func (m *Map) GetCollisionLines(clipDistance float64) []geom.Line

func (*Map) Level

func (m *Map) Level(levelNum int) [][]int

func (*Map) NumLevels

func (m *Map) NumLevels() int

type Player

type Player struct {
	*Entity
	CameraZ    float64
	Moved      bool
	Weapon     *Weapon
	WeaponSet  []*Weapon
	LastWeapon *Weapon
}

func NewPlayer

func NewPlayer(x, y, angle, pitch float64) *Player

func (*Player) AddWeapon

func (p *Player) AddWeapon(w *Weapon)

func (*Player) NextWeapon

func (p *Player) NextWeapon(reverse bool) *Weapon

func (*Player) SelectWeapon

func (p *Player) SelectWeapon(weaponIndex int) *Weapon

type Projectile

type Projectile struct {
	*Sprite
	Ricochets    int
	Lifespan     float64
	ImpactEffect Effect
}

func NewAnimatedProjectile

func NewAnimatedProjectile(
	x, y, scale float64, animationRate int, img *ebiten.Image, mapColor color.RGBA, columns, rows int,
	anchor raycaster.SpriteAnchor, collisionRadius, collisionHeight float64,
) *Projectile

func NewProjectile

func NewProjectile(
	x, y, scale float64, img *ebiten.Image, mapColor color.RGBA,
	anchor raycaster.SpriteAnchor, collisionRadius, collisionHeight float64,
) *Projectile

func (*Projectile) SpawnEffect

func (p *Projectile) SpawnEffect(x, y, z, angle, pitch float64) *Effect

type Sprite

type Sprite struct {
	*Entity
	W, H          int
	AnimationRate int
	Focusable     bool
	// contains filtered or unexported fields
}

func NewAnimatedSprite

func NewAnimatedSprite(
	x, y, scale float64, animationRate int, img *ebiten.Image, mapColor color.RGBA,
	columns, rows int, anchor raycaster.SpriteAnchor, collisionRadius, collisionHeight float64,
) *Sprite

func NewSprite

func NewSprite(
	x, y, scale float64, img *ebiten.Image, mapColor color.RGBA,
	anchor raycaster.SpriteAnchor, collisionRadius, collisionHeight float64,
) *Sprite

func NewSpriteFromSheet

func NewSpriteFromSheet(
	x, y, scale float64, img *ebiten.Image, mapColor color.RGBA,
	columns, rows, spriteIndex int, anchor raycaster.SpriteAnchor, collisionRadius, collisionHeight float64,
) *Sprite

func (*Sprite) AddDebugLines

func (s *Sprite) AddDebugLines(lineWidth int, clr color.Color)

func (*Sprite) Illumination

func (s *Sprite) Illumination() float64

func (*Sprite) IsFocusable

func (s *Sprite) IsFocusable() bool

func (*Sprite) LoopCounter

func (s *Sprite) LoopCounter() int

func (*Sprite) ResetAnimation

func (s *Sprite) ResetAnimation()

func (*Sprite) Scale

func (s *Sprite) Scale() float64

func (*Sprite) ScreenRect

func (s *Sprite) ScreenRect() *image.Rectangle

func (*Sprite) SetAnimationFrame

func (s *Sprite) SetAnimationFrame(texNum int)

func (*Sprite) SetAnimationReversed

func (s *Sprite) SetAnimationReversed(isReverse bool)

func (*Sprite) SetScreenRect

func (s *Sprite) SetScreenRect(rect *image.Rectangle)

func (*Sprite) SetTextureFacingMap

func (s *Sprite) SetTextureFacingMap(texFacingMap map[float64]int)

func (*Sprite) Texture

func (s *Sprite) Texture() *ebiten.Image

func (*Sprite) TextureRect

func (s *Sprite) TextureRect() image.Rectangle

func (*Sprite) Update

func (s *Sprite) Update(camPos *geom.Vector2)

func (*Sprite) VerticalAnchor

func (s *Sprite) VerticalAnchor() raycaster.SpriteAnchor

type Weapon

type Weapon struct {
	*Sprite
	// contains filtered or unexported fields
}

func NewAnimatedWeapon

func NewAnimatedWeapon(
	x, y, scale float64, animationRate int, img *ebiten.Image, columns, rows int, projectile Projectile, projectileVelocity, rateOfFire float64,
) *Weapon

func (*Weapon) Fire

func (w *Weapon) Fire() bool

func (*Weapon) OnCooldown

func (w *Weapon) OnCooldown() bool

func (*Weapon) ResetCooldown

func (w *Weapon) ResetCooldown()

func (*Weapon) SpawnProjectile

func (w *Weapon) SpawnProjectile(x, y, z, angle, pitch float64, spawnedBy *Entity) *Projectile

func (*Weapon) Update

func (w *Weapon) Update()

Jump to

Keyboard shortcuts

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