Playmaker Forum
PlayMaker News => General Discussion => Topic started by: gamedivision on October 24, 2012, 04:17:56 PM
-
Im starting to learn little by little here is a countdown timer i made during my lunch,i have five states a listener that waits for a send event,the four other states are 3,2,1,go,each state has a set property to the ngui label with the relevant number,and a send event with a delay of 1 second for each.
once it reaches the go go go event,it flies back to the listener with a set property to the ngui with no text,waiting for another send event for whatever that is (say a start of the game)but i put the set property in the listener to remove any visible text,that way i know for sure its removed.
my question is this,is this way over the top and i just don't understand playmaker.or not bad but there is a better way of doing it.
-
Hi,
Indeed, I think it can be optimized, for example, what if you know you need to count dowmnfrom 10, or 3, or 100... this would not turn out very flexible.
instead, have a in variable representing the count down, and an float variable representing the time between each count, and create a simple looping state logic.
I have attached a working scene.
bye,
Jean