I'm trying to design a game with Java, so how can I do to make some of the texts blink? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

I'm trying to design a game with Java, so how can I do to make some of the texts blink?

(e.g. Press any Key, Press Y/N and so on) I'm beginning on this and a little bit of help would come in handy.

3rd Sep 2016, 12:00 AM
Hernán Miguel Villarroel Lugo
2 Answers
+ 2
according to the game engine you are using . but usually the game runs in a loop, for blinking text you can do something like this: boolean blink; gameLoop(){ if(blink)text.setColor(Color.Black); else text.setColor(Color.white); blink=!blink; }
17th Sep 2016, 6:05 PM
Ahmad Samy
Ahmad Samy - avatar
0
Thanks, man! I'm using Eclipse for it... Anyways, there seems to be an error... For the gameloop() { line, it says "The method gameloop() is undefined for the type MainScreen and for the if and else ones, it says "text cannot be resolved." Any suggestions for these errors?
18th Sep 2016, 4:51 PM
Hernán Miguel Villarroel Lugo