agents

package
v0.0.0-...-157546e Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TasingTicks    = logic.TPS
	TasingCooldown = logic.TPS * 5
	TasingRadius   = 10

	ScanningTicks    = logic.TPS * 5
	ScanningCoolDown = logic.TPS * 20
)

Properties

View Source
const (
	PlayerVisibilityRadius = 50

	AgentDefaultMS       = 0.1
	AgentRunMSMultiplier = 3
	AgentRunMS           = AgentDefaultMS * AgentRunMSMultiplier
	JumpingTicks         = logic.TPS / 6
	HeardForTicks        = logic.TPS * 2
	CheatVisionTicks     = logic.TPS * 15
)

Variables

View Source
var (
	DescriptionsByLevel = []string{
		0: "Passives:\n- Noob\n\nAbilities: none",
		1: "Passives:\n- More agile\n\nAbilities:\n- Can turn invisible for 5 seconds (30 seconds cooldown)\n- Can turn the lights off for 10 seconds (once per game)",
		2: "Passives:\n- Noob\n\nAbilities: none",
		3: "Passives:\n- Noob\n\nAbilities: none",
	}
)

Functions

This section is empty.

Types

type Ability

type Ability byte
const (
	AbilityLightsOff Ability = iota
	AbilityTasing
	AbilityScanning
)

type Agent

type Agent interface {
	Update(env *Env)

	GetState() State
	GetAngle() float64
	GetPosition() geom.Vec3
	SetPosition(position geom.Vec3)
	GetIntent() geom.Vec3
	GetGrounded() bool
	SetGrounded(grounded bool)
	GetYVelocity() float64
	SetYVelocity(v float64)
	GetJumpingTicks() uint64
	GetHeard() bool
	SetHeard()

	HasAbility(ability Ability) bool
	Cooldown(ability Ability) float64
}

func NewAgentByLevel

func NewAgentByLevel(lvl int) Agent

type Agent0

type Agent0 struct {
	CurrentPath   []geom.Vec3
	PathIndex     int
	EscapingTicks uint64
	Solved        bool
	// contains filtered or unexported fields
}

func NewAgent0

func NewAgent0() *Agent0

func (*Agent0) Cooldown

func (a0 *Agent0) Cooldown(ability Ability) float64

func (*Agent0) GetAngle

func (b *Agent0) GetAngle() float64

func (*Agent0) GetGrounded

func (b *Agent0) GetGrounded() bool

func (*Agent0) GetHeard

func (b *Agent0) GetHeard() bool

func (*Agent0) GetIntent

func (b *Agent0) GetIntent() geom.Vec3

func (*Agent0) GetJumpingTicks

func (b *Agent0) GetJumpingTicks() uint64

func (*Agent0) GetPosition

func (b *Agent0) GetPosition() geom.Vec3

func (*Agent0) GetState

func (b *Agent0) GetState() State

func (*Agent0) GetYVelocity

func (b *Agent0) GetYVelocity() float64

func (*Agent0) HasAbility

func (a0 *Agent0) HasAbility(ability Ability) bool

func (*Agent0) SetGrounded

func (b *Agent0) SetGrounded(grounded bool)

func (*Agent0) SetHeard

func (b *Agent0) SetHeard()

func (*Agent0) SetPosition

func (b *Agent0) SetPosition(position geom.Vec3)

func (*Agent0) SetYVelocity

func (b *Agent0) SetYVelocity(v float64)

func (*Agent0) Update

func (a0 *Agent0) Update(env *Env)

type Env

type Env struct {
	Level             int
	Map               *level.HMap
	Goal              geom.Vec3
	LastKnownAt       geom.Vec3
	LastKnownAtUpdate bool
	TimeRemaining     uint64
	Seen              bool
	CanSeePlayer      bool
}

type Player

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

func NewPlayer

func NewPlayer() *Player

func (*Player) Cooldown

func (p *Player) Cooldown(ability Ability) float64

func (*Player) GetAngle

func (b *Player) GetAngle() float64

func (*Player) GetGrounded

func (b *Player) GetGrounded() bool

func (*Player) GetHeard

func (b *Player) GetHeard() bool

func (*Player) GetIntent

func (b *Player) GetIntent() geom.Vec3

func (*Player) GetJumpingTicks

func (b *Player) GetJumpingTicks() uint64

func (*Player) GetPosition

func (b *Player) GetPosition() geom.Vec3

func (*Player) GetState

func (b *Player) GetState() State

func (*Player) GetYVelocity

func (b *Player) GetYVelocity() float64

func (*Player) HasAbility

func (p *Player) HasAbility(ability Ability) bool

func (*Player) SetGrounded

func (b *Player) SetGrounded(grounded bool)

func (*Player) SetHeard

func (b *Player) SetHeard()

func (*Player) SetPosition

func (b *Player) SetPosition(position geom.Vec3)

func (*Player) SetYVelocity

func (b *Player) SetYVelocity(v float64)

func (*Player) Update

func (p *Player) Update(env *Env)

type State

type State = byte
const (
	StateIdle State = iota
	StateWalking
	StateRunning
	StateJumping
	StateWalkJumping
	StateFalling
)

Jump to

Keyboard shortcuts

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