(dt float32)
| 110 | } |
| 111 | |
| 112 | func (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 | |
| 128 | type RockSpawnSystem struct { |
| 129 | world *ecs.World |
nothing calls this directly
no test coverage detected