func (c *ScoreSystem) Update(entity *engi.Entity, dt float32) { var render *engi.RenderComponent var space *engi.SpaceComponent if !entity.Component(&render) || !entity.Component(&space) { return } if !c.upToDate { c.scoreLock.RLock() render.Label = fmt.Sprintf("%v vs %v", c.PlayerOneScore, c.PlayerTwoScore) c.upToDate = true c.scoreLock.RUnlock() render.Display = basicFont.Render(render.Label) width := len(render.Label) * 20 space.Position.X = float32(400 - (width / 2)) } }