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.
3 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;
}
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?
0
Hey, creative spirit! Designing a game in Java sounds like an awesome journey! To make some of the text blink, you might want to explore using timers or threads to control the text display. Itâs like adding a little extra sparkle to your game, making it even more captivating.
And while youâre weaving your gameâs magic, check out Crazy Pachinko https://crazy-pachinko.com/tr/ itâs a playful adventure with chances and strategies, reminding us that every game has its own unique rhythm. Keep the creativity flowing and enjoy the ride!