MCPcopy
hub / github.com/EngoEngine/engo / Update

Method Update

common/animation.go:134–149  ·  view source on GitHub ↗

Update advances the animations of all tracked entities.

(dt float32)

Source from the content-addressed store, hash-verified

132
133// Update advances the animations of all tracked entities.
134func (a *AnimationSystem) Update(dt float32) {
135 for _, e := range a.entities {
136 if e.AnimationComponent.CurrentAnimation == nil {
137 if e.AnimationComponent.def == nil {
138 continue
139 }
140 e.AnimationComponent.SelectAnimationByAction(e.AnimationComponent.def)
141 }
142
143 e.AnimationComponent.change += dt
144 if e.AnimationComponent.change >= e.AnimationComponent.Rate {
145 e.RenderComponent.Drawable = e.AnimationComponent.Cell()
146 e.AnimationComponent.NextFrame()
147 }
148 }
149}

Callers

nothing calls this directly

Calls 3

NextFrameMethod · 0.80
CellMethod · 0.45

Tested by

no test coverage detected