To make the flower blink continuously you can use an if statement and a variable. For instance:
int timeTillBlink = 0;
if ( timeTillBlink >= 10 )
{
blink(); // does whatever blink does.
timeTillBlink = 10; // resets timeTillBlink to ten or whatever number you would like.
}
else
timeTillBlink--; // ( same as timeTillBlink = timeTillBlink - 1 ) delays the blink process by ___ number of act cycles.
To have the crab slow down, you can also use an if statement:
int time2moveOn = 5;
if ( isTouching( flower.class ) & time2moveOn > 0 ) // time2moveOn will stop the crab from smelling the flower
{
smell(); // can do something to show it smelled the flower, not needed.
time2moveOn--; // starts counting down for the crab to continue.
}
else
move( speed ); // move the crab if not next to a flower. you can define speed.
Of course you can have the flower blink less often by making timeTillBlink larger and have the crab move on faster by making time2moveOn less. I hope this helps!