Documentation ¶
Index ¶
- Constants
- Variables
- func CleanupActiveOrgan(cleared bool)
- func CleanupEnemies()
- func CleanupEntities()
- func CleanupTiles()
- func EnemySwordDash(p *Entity)
- func FadeBy(f float64) mod.Filter
- func ImageTiles(rgba *image.RGBA) [][]Tile
- func Init()
- func LevelEnd() (nextScene string, result *oak.SceneResult)
- func LevelInit(prevScene string, inLevel interface{})
- func LevelLoop() bool
- func NetLeft(label collision.Label) func(*Entity)
- func NetRight(label collision.Label) func(*Entity)
- func NetRotateAbout(r *render.Reverting, pos, center physics.Vector, angle float64)
- func NetTwirl(label collision.Label) func(*Entity)
- func NewBasicOrgan(x, y float64, w, h float64, r render.Modifiable, typ OrganType) *basicOrgan
- func NewVent(x, y int, r render.Renderable)
- func NodeCenter(bn BodyNode) physics.Vector
- func PlayAt(s string, x, y float64)
- func RotateAbout(r render.Modifiable, pos, center physics.Vector, angle float64)
- func ShapeTiles(sh shape.Shape, w, h int) [][]Tile
- func Shoot(speed, accel float64, w int, c color.Color, label collision.Label, ...) func(e *Entity)
- func SpearDash(label collision.Label) func(*Entity)
- func SpearJab(label collision.Label) func(*Entity)
- func SpearThrust(label collision.Label) func(*Entity)
- func Summon(ec EnemyCreation) func(*Entity)
- func SwordDash(label collision.Label) func(p *Entity)
- func SwordLeft(label collision.Label) func(p *Entity)
- func SwordRight(label collision.Label) func(p *Entity)
- func SwordRotateAbout(r *render.Reverting, pos, center physics.Vector, angle float64)
- func Vacuum(p *Entity)
- func WhipLeft(label collision.Label) func(p *Entity)
- func WhipRight(label collision.Label) func(p *Entity)
- func WhipTwirl(label collision.Label) func(p *Entity)
- type Action
- type AttackSet
- type Body
- func (b *Body) AddNodes(ns ...BodyNode)
- func (b *Body) Connect(a, c int) bool
- func (b *Body) Infect(i int)
- func (b *Body) InfectionPattern(pattern [][]int)
- func (b *Body) InfectionProgress()
- func (b *Body) InitVeins()
- func (b *Body) IsAdjacent(i, j int) bool
- func (b *Body) Stats() menu.LevelStats
- func (b *Body) VecIndex(v physics.Vector) int
- type BodyButton
- type BodyNode
- type BodyTraveler
- type Direction
- type Enemy
- func NewBoomer(x, y int, diff float64, summoned bool) *Enemy
- func NewDasher(x, y int, diff float64, summoned bool) *Enemy
- func NewEnemy(x, y, w, h float64, r render.Renderable, ...) (e *Enemy)
- func NewMelee(x, y int, diff float64, summoned bool) *Enemy
- func NewRanged(x, y int, diff float64, summoned bool) *Enemy
- func NewSummoner(x, y int, diff float64, summoned bool) *Enemy
- func NewVacuumer(x, y int, diff float64, summoned bool) *Enemy
- func NewWizard(x, y int, diff float64, summoned bool) *Enemy
- type EnemyCreation
- type EnemyDist
- type EnemyType
- type Entity
- type HasE
- type Infectable
- type MoveSet
- type Organ
- type OrganType
- type Player
- type Shot
- type Tile
- type Vein
- type VeinNode
- type Vent
- type Wave
- type Weapon
Constants ¶
Variables ¶
var ( MoveForward = NewAction((*Entity).moveForward, 0) MoveBackward = NewAction((*Entity).moveBack, 0) MoveRight = NewAction((*Entity).moveRight, 0) MoveLeft = NewAction((*Entity).moveLeft, 0) TeleportForward = func(d float64) *Action { return NewAction(func(e *Entity) { e.teleportForward(d) }, 0) } TeleportBackward = func(d float64) *Action { return NewAction(func(e *Entity) { e.teleportBack(d) }, 0) } TeleportRight = func(d float64) *Action { return NewAction(func(e *Entity) { e.teleportRight(d) }, 0) } TeleportLeft = func(d float64) *Action { return NewAction(func(e *Entity) { e.teleportLeft(d) }, 0) } )
var ( SingleMelee = EnemyDist{1, []float64{1.0, 0.0, 0.0}} SmallMeleeDist = EnemyDist{8, []float64{1.0, 0.0, 0.0}} ModerateMeleeDist = EnemyDist{16, []float64{1.0, 0.0, 0.0}} LargeMeleeDist = EnemyDist{24, []float64{1.0, 0.0, 0.0}} SmallRangedDist = EnemyDist{8, []float64{0.0, 1.0, 0.0}} ModerateRangedDist = EnemyDist{16, []float64{0.0, 1.0, 0.0}} LargeRangedDist = EnemyDist{24, []float64{0.0, 1.0, 0.0}} SmallSpecialDist = EnemyDist{8, []float64{0.0, 0.0, 1.0}} ModerateSpecialDist = EnemyDist{16, []float64{0.0, 0.0, 1.0}} LargeSpecialDist = EnemyDist{24, []float64{0.0, 0.0, 1.0}} SmallBalancedDist = EnemyDist{8, []float64{1.0, 1.0, 1.0}} ModerateBalancedDist = EnemyDist{16, []float64{1.0, 1.0, 1.0}} LargeBalancedDist = EnemyDist{24, []float64{1.0, 1.0, 1.0}} SmallNoMeleeDist = EnemyDist{8, []float64{0.0, 1.0, 1.0}} ModerateNoMeleeDist = EnemyDist{16, []float64{0.0, 1.0, 1.0}} LargeNoMeleeDist = EnemyDist{24, []float64{0.0, 1.0, 1.0}} SmallNoSpecialDist = EnemyDist{8, []float64{1.0, 1.0, 0.0}} ModerateNoSpecialDist = EnemyDist{16, []float64{1.0, 1.0, 0.0}} LargeNoSpecialDist = EnemyDist{24, []float64{1.0, 1.0, 0.0}} SmallNoRangedDist = EnemyDist{8, []float64{1.0, 0.0, 1.0}} ModerateNoRangedDist = EnemyDist{16, []float64{1.0, 0.0, 1.0}} LargeNoRangedDist = EnemyDist{24, []float64{1.0, 0.0, 1.0}} )
var ( SMD = SmallMeleeDist MMD = ModerateMeleeDist LMD = LargeMeleeDist SRD = SmallRangedDist MRD = ModerateRangedDist LRD = LargeRangedDist SSD = SmallSpecialDist MSD = ModerateSpecialDist LSD = LargeSpecialDist SBD = SmallBalancedDist MBD = ModerateBalancedDist LBD = LargeBalancedDist SNMD = SmallNoMeleeDist MNMD = ModerateNoMeleeDist LNMD = LargeNoMeleeDist SNSD = SmallNoSpecialDist MNSD = ModerateNoSpecialDist LNSD = LargeNoSpecialDist SNRD = SmallNoRangedDist MNRD = ModerateNoRangedDist LNRD = LargeNoRangedDist )
var ( Sword = Weapon{ // contains filtered or unexported fields } Whip = Weapon{ // contains filtered or unexported fields } Spear = Weapon{ // contains filtered or unexported fields } Net = Weapon{ // contains filtered or unexported fields } )
Functions ¶
func CleanupActiveOrgan ¶
func CleanupActiveOrgan(cleared bool)
TODO: Refactor this name CleanupActiveOrgan cleans up when leaving an organ to return to body map
func CleanupEnemies ¶
func CleanupEnemies()
func CleanupEntities ¶
func CleanupEntities()
func EnemySwordDash ¶
func EnemySwordDash(p *Entity)
func ImageTiles ¶
func LevelEnd ¶
func LevelEnd() (nextScene string, result *oak.SceneResult)
func NetRotateAbout ¶
func NewBasicOrgan ¶
func NewBasicOrgan(x, y float64, w, h float64, r render.Modifiable, typ OrganType) *basicOrgan
NewBasicOrgan creates a new default organ
func NewVent ¶
func NewVent(x, y int, r render.Renderable)
func NodeCenter ¶
TODO: Is this function in the right file? NodeCenter returns the center of a body node
func RotateAbout ¶
func RotateAbout(r render.Modifiable, pos, center physics.Vector, angle float64)
func SpearThrust ¶
func Summon ¶
func Summon(ec EnemyCreation) func(*Entity)
func SwordRight ¶
func SwordRotateAbout ¶
Types ¶
type Action ¶
type AttackSet ¶
type Body ¶
type Body struct {
// contains filtered or unexported fields
}
func Body4 ¶
func Body4() *Body
---------------------------- Body4 infection of the (Lung Stomach) (Brain Liver) Heart
func Body5 ¶
func Body5() *Body
Body5 infection of the (Liver Heart Stomach) (Brain Lung Lung Heart) (Brain)
func (*Body) Connect ¶
Connect connects two bodyNodes on a body, and returns whether it succeeds. Failure indicates that the two nodes were already connected, or an input node did not exist
func (*Body) Infect ¶
Infect infects organs that have not previously been cleansed. If an organ is not already infected it is then added to the body's diseased organs list.
func (*Body) InfectionPattern ¶
func (*Body) InfectionProgress ¶
func (b *Body) InfectionProgress()
InfectionProgress is called when an organ is finished and is responsible for updating overall infection and level progress
func (*Body) IsAdjacent ¶
IsAdjacent returns whether the nodes at indices i and j in this graph are adjacent
func (*Body) Stats ¶
func (b *Body) Stats() menu.LevelStats
type BodyButton ¶
type BodyButton struct { mouse.CollisionPhase *collision.Space // contains filtered or unexported fields }
func NewBodyButton ¶
func NewBodyButton(w, h float64) *BodyButton
func (*BodyButton) IsTravelerAdjacent ¶
func (bb *BodyButton) IsTravelerAdjacent() bool
func (*BodyButton) SetPos ¶
func (bb *BodyButton) SetPos(v physics.Vector)
SetPos sets the location for the BodyButton
type BodyNode ¶
type BodyNode interface { Vec() physics.Vector Dims() (int, int) SetPos(physics.Vector) Organ() (Organ, bool) Infect(...float64) bool DiseaseLevel() float64 Cleanse() R() render.Modifiable }
BodyNode is a node on the body that can be traveled to
type BodyTraveler ¶
A BodyTraveler is an entity that travels along the veins of a body on the body layer
func NewBodyTraveler ¶
func NewBodyTraveler(x, y float64) *BodyTraveler
NewBodyTraveler creates a BodyTraveler, binding the appropriate functions to a Sprite
func (*BodyTraveler) CenterPos ¶
func (bt *BodyTraveler) CenterPos() physics.Vector
CenterPos returns a vector to the center of BodyTraveler
func (*BodyTraveler) Init ¶
func (bt *BodyTraveler) Init() event.CID
Init obtains a CID for an entity
type EnemyDist ¶
func RandomDist ¶
type Entity ¶
type Entity struct { entities.Interactive physics.Mass Dir physics.Vector // contains filtered or unexported fields }
type Infectable ¶
type Infectable struct { Disease float64 // contains filtered or unexported fields }
func (*Infectable) Cleanse ¶
func (i *Infectable) Cleanse()
func (*Infectable) DiseaseLevel ¶
func (i *Infectable) DiseaseLevel() float64
func (*Infectable) Infect ¶
func (i *Infectable) Infect(fs ...float64) bool
func (*Infectable) R ¶
func (i *Infectable) R() render.Modifiable
type Organ ¶
func NewStomach ¶
type VeinNode ¶
type VeinNode struct { physics.Vector *BodyButton Infectable }
VeinNode is a simple node that is NOT an Organ
func NewVeinNode ¶
NewVeinNode creates a vein node
func NewVeinNodes ¶
NewVeinNodes returns a set of vein nodes, pairing together adjacent float inputs as x,y pairs
Source Files ¶
- action.go
- attackSet.go
- audio.go
- bodies.go
- body.go
- bodyButton.go
- bodyNode.go
- bodyTravel.go
- direction.go
- enemy.go
- enemyDist.go
- enemyTypes.go
- entity.go
- entityCollision.go
- infectable.go
- init.go
- level.go
- moveSet.go
- net.go
- organ.go
- organTypes.go
- player.go
- shot.go
- spear.go
- sword.go
- tile.go
- vein.go
- veinNode.go
- ventricle.go
- viewport.go
- walls.go
- wave.go
- weapons.go
- whip.go