MCPcopy Index your code
hub / github.com/EngoEngine/engo / Update

Method Update

demos/headless/headless.go:309–322  ·  view source on GitHub ↗
(dt float32)

Source from the content-addressed store, hash-verified

307}
308
309func (c *ControlSystem) Update(dt float32) {
310 for _, e := range c.entities {
311 speed := 800 * dt
312
313 vert := engo.Input.Axis(engo.DefaultVerticalAxis)
314 e.SpaceComponent.Position.Y += speed * vert.Value()
315
316 if (e.SpaceComponent.Height + e.SpaceComponent.Position.Y) > 800 {
317 e.SpaceComponent.Position.Y = 800
318 } else if e.SpaceComponent.Position.Y < 0 {
319 e.SpaceComponent.Position.Y = 0
320 }
321 }
322}
323
324type scoreEntity struct {
325 *ecs.BasicEntity

Callers

nothing calls this directly

Calls 2

AxisMethod · 0.80
ValueMethod · 0.65

Tested by

no test coverage detected