Count up and down elegantly
I am trying to make a blinking object i.e. increase its alpha value from 0 to 255 (gradually), then go back to 0 and repeat.
Is there a way that I can do this without using some booleans? It's easy to increment it:
alpha = time.elapsed()%256;
But what's a good way to make him fall asleep again after that?
+2
source to share
3 answers