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

Method Update

demos/entityscroller/entityscroller.go:41–54  ·  view source on GitHub ↗
(dt float32)

Source from the content-addressed store, hash-verified

39}
40
41func (c *ControlSystem) Update(dt float32) {
42 if engo.Input.Button("moveup").Down() {
43 c.entity.SpaceComponent.Position.Y -= 5
44 }
45 if engo.Input.Button("movedown").Down() {
46 c.entity.SpaceComponent.Position.Y += 5
47 }
48 if engo.Input.Button("moveleft").Down() {
49 c.entity.SpaceComponent.Position.X -= 5
50 }
51 if engo.Input.Button("moveright").Down() {
52 c.entity.SpaceComponent.Position.X += 5
53 }
54}
55
56func (game *GameWorld) Preload() {
57 // A tmx file can be generated from the Tiled Map Editor.

Callers

nothing calls this directly

Calls 2

ButtonMethod · 0.80
DownMethod · 0.45

Tested by

no test coverage detected