Good evening fellow programmers, I desparately require your assistance if you please. I was having great difficulty with transparency of an object but "danpost" kindly assisted me with that...but I am still confused however about making an object blink continuously.
Why is this same code not allowing my to change the -5 to a 0 OR 255 to allow the turtle to blink continuously for me? I keep getting errors. I read that it cant go below zero & has to be 0-255 yet negative 5 overrides this rule. I was assuming by alternating 0 & 255 that it would make the turtle be at full capacity then blink if you will to invisible & back to full & repeat that cycle but my executions are not working.
Another user stated their method for transparency was this:
public void act()
{
if(canSee(Crab.class))
{
i=getImage();
t=i.getTransparency()-5;
if(t<0)
{
t=0;
}
i.setTransparency(t);
setImage(i);
}
}
this is the question/code I piggybacked off of from here PLEASE CLICK
Again, I am new to this so please forgive my ignorance.
Thank you in advance for any assistance you may provide.
Good day

