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

Method Update

demos/falling/falling.go:112–126  ·  view source on GitHub ↗
(dt float32)

Source from the content-addressed store, hash-verified

110}
111
112func (c *ControlSystem) Update(dt float32) {
113 speed := 400 * dt
114
115 for _, e := range c.entities {
116 hori := engo.Input.Axis(engo.DefaultHorizontalAxis)
117 e.SpaceComponent.Position.X += speed * hori.Value()
118
119 vert := engo.Input.Axis(engo.DefaultVerticalAxis)
120 e.SpaceComponent.Position.Y += speed * vert.Value()
121
122 if e.SpaceComponent.Position.Y > engo.GameHeight() {
123 c.Remove(*e.BasicEntity)
124 }
125 }
126}
127
128type RockSpawnSystem struct {
129 world *ecs.World

Callers

nothing calls this directly

Calls 4

RemoveMethod · 0.95
GameHeightFunction · 0.92
AxisMethod · 0.80
ValueMethod · 0.65

Tested by

no test coverage detected