Most games have various counters such as balance, health, position etc.
As there is no "on value change" event, MVC or similar for such values, rather than duplicate the GUI update code in every place which can update the values, I have 10 "every tick" actions to do things like:
1) calculated and show the latest balance on screen
2) show the latest bet amount on screen
3) set any anchored objects to the right X/Y position based on viewport (anchor behaviour doesnt do what I need)
etc.
<img src="http://www.ohds.co.uk/c2/everytick.PNG" border="0" />
When I run the game, I get 6fps when Idle (I.e. absolutely nothing happening - no movement, no animations) on the iphone 4. If I disable the onticks, I get 60fps. I still only get 1fps if I move a tiled background across the screen, but thats another post.
I saw someone say that C2 is intelligent enough to only run the ontick action if one of the values has changed. This does not seem to be the case.
What is the best strategy for this?
Does everyone store the "last value" of each variable, then do checks to see if it has changed every tick? This will also incur an overhead.
Any magic solutions, e.g. to make an event out of a value change such that it can be caught and actions can be defined in one place?
Thanks!