The Counter Object in PubCoder is an object that can be referred to increase and decrease its value while the user interacts to trigger actions at a given value. For example, you can assign a list of actions after an object has been touched 5 times, or if you want to provide a feedback to the end user after a drag & drop of a certain number of objects is completed.

How to use the Counter Object in your project:

1- drag and drop the Object from the Objects Panel wherever you like on the stage. The position of the counter is not important, as it is invisible to the end user.

Counter Object

2- In the Object Inspector define:

  • Target Value: the value of the counter sensible to the event “Reached Value”, default is 2
  • Initial Value: the starting value of the counter, default is 0
  • Can Exceed Target Value: if checked the counter may exceed the Target Value, when increased

Counter Object Inspector

3- Assign an action to any object to increase, decrease or change value to the counter

Counter example page

Counter Increase Action

4- From the Counter Object select the desired event (Decrease, Increase, Value Change, Reached Target Value) and trigger the desired action or sequence of actions

Counter Event Changed Value Counter Event Increase Counter Reached Event