I would like to put a little text object on each and every obstacle object to report numbers and details for the player. It seems simple enough for me to create N obstacle objects and then add N text objects but it's not clear to me how I should go linking the two. The instance variables, for instance, only hold numbers, booleans and strings, not pointers to objects.
Any suggestions for how to do this elegantly and in a way to allow for future expansion? Ideally, I would like to just create N pairs of obstacle objects and text objects with a loop instead of drawing them by hand.