I suggest to use an MVC architecture on your implementation.
The Model is the part that keeps the “stats”. This can be anything. A property of a game object, a Python data structure or whatever.
The View is the part that shows the status of the model to the user. In your case the Text object. It can be a bar, a slider or a animated mesh. It can even be … nothing (no information is information too ;)). Either way the View can be multiple objects.
The Controller (not the controller brick ;)). Deals with input, e.g. changes to a slider, keyboard input … anything that interacts with the model.
Typically the model does not know about view and controller. It can live without them.
The view knows the model and operates on changes of the model to show the respective status. A view can show the status of the complete model, or parts of it. There can be several views to the same model/value. The model should not care how many views are present. The view does not know the controllers. As it shows the state ofthe model, there is no need to know about controllers.
The controller processes input to the model. This means it triggers triggers operations on the model and updates the views. Typically a controller has a close relation ship to a specific view and the model.
I guess … too much theory.
How to apply to your situation. As you do not want input (yet) we can skip the controller part and focus on model and view.
Unfortunatelly you did not tell where “information” is coming from. So I assume you have an object “Model” with property “death time” and “kills”, The view is a bunch of text objects with some fancy graphics around it.
Basically you already have an implementation:
Whenever the property “death time” changes you send a message “death time changed” to the view. As the model does not know the view(s). So you do not send the message t oa specific target. The interested views can simply listen to the message “death time changed” to get notified for update.
Now there are multiple options:
-
You send the new value within the message body. This way the view can extract it from there. This is fine on string values or values that can easily be converted to and from stings (as the message body is string). Due to the dynamic nature you need Python to read the body.
-
Treat the message as notification and let the view access the model to get the according values. Typically you need Python to read the model (e.g. the property value from model object).
There are more options, even without Python. Typically they are based on some assumption (e.g. one message = one increment; one message per frame only).
You can read about using messages in
Maybe it helps
Edit: I forgot to mention that using a model makes it extremely easy to save it to a file.