Make-your-own-Brain
tutorial
Brain
s provide logic for displaying LifeEvent
s around the screen. If you want to create a handle for your stuffs, say to go to edge of the universe, you extend the base empathy::brain::Brain
class. Like this:
class RocketBrain : public Brain;
This class MUST override a method named runLineNumber. you do this by:
public void runLineNumber(String action, String caller);
Now, you have to understand HOW Brain works to understand what this statement is. The Brain is started by You
and as it begins running, it starts asynchronous timeouts to create LifeEvent
s. Say, you want to build a wave of red color and a wave of blue color immediately afterwards. Your implementationn should be like:
onStart: wave1 after 3 seconds: wave2 (for simplicity, say the wave completes in 3 seconds)
The use of runLineNumber
is to execute a certain statement and create the intruction for timeouts. Your runLineNumber needs to be like:
You might have noticed action==”begin” on line 3. This comes from You
after empathy has finished instanciating.