I need to make a flower blink whenever a crab walks by.
Here is the directions from the teacher:
Flower - you should create a Blink method...the Flower will blink on and off continuously (Hint...save the Flower's current transparency in a variable, set the transparency to zero, and then set the transparency back to the value you have saved in the variable...you must also call Greenfoot's delay() method after setting/re-setting the transparency). In a week or two I will give you more help with the Flower's blinking, but I would like you to try this challenge first by yourself.
Here is what I have written:
public void act()
{
blink();
}
public void blink()
{
if (canSee(Crab.class))
{
GreenfootImage i = getImage();
int t = i.getTransparency();
t = 0;
i.setTransparency(t);
setImage(i);
}
if (setTransparency(0))
{
t = 100;
}
I know it's probably not correct, but I just can't figure it out

