Documentation ¶
Index ¶
- Variables
- func ClosestTarget(w donburi.World, entry *donburi.Entry, lookFor *query.Query) *donburi.Entry
- func MustFindLevel(w donburi.World) *donburi.Entry
- type AIData
- type AIType
- type AltitudeData
- type BoundsData
- type CameraData
- type CollectibleData
- type CollectibleType
- type ColliderData
- type ColliderLayer
- type ColorOverride
- type DebugData
- type DespawnableData
- type EvolutionData
- type FollowerData
- type GameData
- type HealthData
- type InputData
- type LabelData
- type LevelData
- type ObserverData
- type PlayerAirplaneData
- type PlayerData
- type PlayerFaction
- type PlayerSelectData
- type ScriptData
- type Settings
- type ShooterData
- type ShooterType
- type SpawnFunc
- type SpawnableData
- type SpriteData
- type SpriteLayer
- type SpritePivot
- type VelocityData
- type WeaponLevel
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ShadowTag = donburi.NewTag() CurrentEvolutionTag = donburi.NewTag() NextEvolutionTag = donburi.NewTag() Wreckable = donburi.NewTag() )
View Source
var AI = donburi.NewComponentType[AIData]()
View Source
var Altitude = donburi.NewComponentType[AltitudeData]()
View Source
var Bounds = donburi.NewComponentType[BoundsData]()
Bounds indicates that the entity can't move of out the screen.
View Source
var Camera = donburi.NewComponentType[CameraData]()
View Source
var Collectible = donburi.NewComponentType[CollectibleData]()
View Source
var Collider = donburi.NewComponentType[ColliderData]()
View Source
var Debug = donburi.NewComponentType[DebugData]()
View Source
var Despawnable = donburi.NewComponentType[DespawnableData]()
View Source
var Evolution = donburi.NewComponentType[EvolutionData]()
View Source
var Follower = donburi.NewComponentType[FollowerData]()
View Source
var Game = donburi.NewComponentType[GameData]()
View Source
var Health = donburi.NewComponentType[HealthData](HealthData{ DamageIndicatorTimer: engine.NewTimer(time.Millisecond * 100), })
View Source
var Input = donburi.NewComponentType[InputData]()
View Source
var Label = donburi.NewComponentType[LabelData]()
View Source
var Level = donburi.NewComponentType[LevelData]()
View Source
var Observer = donburi.NewComponentType[ObserverData]()
View Source
var Player = donburi.NewComponentType[PlayerData]()
View Source
var PlayerAirplane = donburi.NewComponentType[PlayerAirplaneData]()
View Source
var PlayerSelect = donburi.NewComponentType[PlayerSelectData]()
View Source
var Script = donburi.NewComponentType[ScriptData]()
View Source
var Shooter = donburi.NewComponentType[ShooterData]()
View Source
var Spawnable = donburi.NewComponentType[SpawnableData]()
View Source
var Sprite = donburi.NewComponentType[SpriteData]()
View Source
var Velocity = donburi.NewComponentType[VelocityData]()
Functions ¶
func ClosestTarget ¶
Types ¶
type AltitudeData ¶
type AltitudeData struct { // Altitude is the level above the ground, in percent. // 0.0 is ground level, 1.0 is the highest point. Altitude float64 Velocity float64 // TODO: Not sure if this fits this component Falling bool }
func (*AltitudeData) Update ¶
func (a *AltitudeData) Update()
type BoundsData ¶
type BoundsData struct {
Disabled bool
}
type CameraData ¶
type CollectibleData ¶
type CollectibleData struct {
Type CollectibleType
}
type CollectibleType ¶
type CollectibleType int
const ( CollectibleTypeHealth CollectibleType = iota CollectibleTypeWeaponUpgrade CollectibleTypeShield )
type ColliderData ¶
type ColliderData struct { Width float64 Height float64 Layer ColliderLayer }
type ColliderLayer ¶
type ColliderLayer int
const ( CollisionLayerPlayerBullets ColliderLayer = iota CollisionLayerEnemyBullets CollisionLayerGroundEnemies CollisionLayerAirEnemies CollisionLayerPlayers CollisionLayerCollectibles )
type ColorOverride ¶
type ColorOverride struct {
R, G, B, A float64
}
type DespawnableData ¶
type DespawnableData struct { // Set when the unit first appears on-screen Spawned bool }
type EvolutionData ¶
type EvolutionData struct { Level int Evolving bool StartedEvolving bool GrowTimer *engine.Timer ShrinkTimer *engine.Timer }
func (*EvolutionData) Evolve ¶
func (e *EvolutionData) Evolve()
func (*EvolutionData) StopEvolving ¶
func (e *EvolutionData) StopEvolving()
type FollowerData ¶
type GameData ¶
func MustFindGame ¶
type HealthData ¶
type HealthData struct { Health int JustDamaged bool DamageIndicatorTimer *engine.Timer DamageIndicator *SpriteData }
func (*HealthData) Damage ¶
func (d *HealthData) Damage()
func (*HealthData) HideDamageIndicator ¶
func (d *HealthData) HideDamageIndicator()
type PlayerAirplaneData ¶
type PlayerAirplaneData struct { PlayerNumber int // TODO Duplicated across PlayerAirplane and Player? Faction PlayerFaction Invulnerable bool InvulnerableTimer *engine.Timer InvulnerableIndicator *SpriteData }
func (*PlayerAirplaneData) StartInvulnerability ¶
func (d *PlayerAirplaneData) StartInvulnerability()
func (*PlayerAirplaneData) StopInvulnerability ¶
func (d *PlayerAirplaneData) StopInvulnerability()
type PlayerData ¶
type PlayerData struct { PlayerNumber int PlayerFaction PlayerFaction Lives int Respawning bool RespawnTimer *engine.Timer WeaponLevel WeaponLevel ShootTimer *engine.Timer }
func (*PlayerData) AddLive ¶
func (d *PlayerData) AddLive()
func (*PlayerData) Damage ¶
func (d *PlayerData) Damage()
func (*PlayerData) EvolutionLevel ¶
func (d *PlayerData) EvolutionLevel() int
func (*PlayerData) UpgradeWeapon ¶
func (d *PlayerData) UpgradeWeapon()
func (*PlayerData) WeaponCooldown ¶
func (d *PlayerData) WeaponCooldown() time.Duration
type PlayerFaction ¶
type PlayerFaction int
const ( PlayerFactionBlue PlayerFaction = iota PlayerFactionRed PlayerFactionGreen PlayerFactionYellow )
func MustPlayerFactionFromString ¶
func MustPlayerFactionFromString(s string) PlayerFaction
type PlayerSelectData ¶
type PlayerSelectData struct { Index int Faction PlayerFaction Selected bool Ready bool PlayerNumber int }
func (*PlayerSelectData) LockIn ¶
func (p *PlayerSelectData) LockIn()
func (*PlayerSelectData) Release ¶
func (p *PlayerSelectData) Release()
func (*PlayerSelectData) Select ¶
func (p *PlayerSelectData) Select(playerNumber int)
func (*PlayerSelectData) Unselect ¶
func (p *PlayerSelectData) Unselect()
type ScriptData ¶
type ShooterData ¶
type ShooterData struct { Type ShooterType ShootTimer *engine.Timer }
type ShooterType ¶
type ShooterType int
const ( ShooterTypeBullet ShooterType = iota ShooterTypeMissile ShooterTypeBeam )
type SpawnableData ¶
type SpawnableData struct {
SpawnFunc SpawnFunc
}
type SpriteData ¶
type SpriteData struct { Image *ebiten.Image Layer SpriteLayer Pivot SpritePivot // The original rotation of the sprite // "Facing right" is considered 0 degrees OriginalRotation float64 Hidden bool ColorOverride *ColorOverride }
func (*SpriteData) Hide ¶
func (s *SpriteData) Hide()
func (*SpriteData) Show ¶
func (s *SpriteData) Show()
type SpriteLayer ¶
type SpriteLayer int
const ( SpriteLayerBackground SpriteLayer = iota SpriteLayerDebris SpriteLayerGroundUnits SpriteLayerGroundGuns SpriteLayerShadows SpriteLayerCollectibles SpriteLayerFallingWrecks SpriteLayerAirUnits SpriteLayerIndicators )
type SpritePivot ¶
type SpritePivot int
const ( SpritePivotCenter SpritePivot = iota SpritePivotTopLeft )
type VelocityData ¶
type WeaponLevel ¶
type WeaponLevel int
const ( WeaponLevelSingle WeaponLevel = iota WeaponLevelSingleFast WeaponLevelDouble WeaponLevelDoubleFast WeaponLevelDiagonal WeaponLevelDoubleDiagonal )
Source Files ¶
Click to show internal directories.
Click to hide internal directories.