Event for global variable value change?

0 favourites
  • 2 posts
From the Asset Store
Very simple code without excess options (15 events for server and 11 events for client)
  • Im used to event driven frameworks like Actionscript and Flash.

    I am trying to figure out how to raise/handle a value change event.

    E.g.

    You have a global variable called chipBalance.

    The balance is updated in several places (e.g. start game deducts from it, winning adds to it).

    You only want to update the balance on the screen when the value changes. You certainly dont want to poll the value every tick (for lots of events, this will kill performance, and is poor solution). You also dont want to duplicate the code to update the balnace on the screen in every place where the blance can change - you need an event!

    I cant find it though. Anyone know how to do this without polling very tick?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • What's so bad about updating every tick? It will use a negligable amount of CPU, and Construct 2's engine does not redraw the screen if nothing has changed (e.g. if you 'set text' and set the same text it already has). It certainly won't kill the performance.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)