This site requires JavaScript, please enable it in your browser!
Greenfoot back
Jargy
Jargy wrote ...

2019/6/28

Showtext..

Jargy Jargy

2019/6/28

#
Hello! How to remove my showtext? showText("Level up!", 350, 250); How to remove it?
danpost danpost

2019/6/28

#
Jargy wrote...
Hello! How to remove my showtext? showText("Level up!", 350, 250); How to remove it?
Either replace it with an empty string:
showText("", 350, 250);
or remove it altogether:
showText(null, 350, 250);
Jargy Jargy

2019/6/28

#
i already tried .. it doesnt work level = level +1; time = time + 1500; removeObjects(getObjects(Zombie1.class)); removeObjects(getObjects(Zombie2.class)); removeObjects(getObjects(Zombie3.class)); showText("Level up!", 350, 250); showText("Zombie will be more stronger!", 350, 300); timer_message--; if(timer_message <= 0) { showText("", 350, 250); showText("", 350, 300); }
Super_Hippo Super_Hippo

2019/6/28

#
This code is probably only executed once, so timer_message won't reach 0.
Jargy Jargy

2019/6/28

#
So how can i fix that?
Reversatile Reversatile

2019/6/28

#
Code Reversatile will help you!
blidgebron blidgebron

2019/6/28

#
Thanks for the help, i haqd the same problem and it fixed it. Tahnks for the help reversdatile.
Jargy Jargy

2019/6/28

#
Reversatile wrote...
Code Reversatile will help you!
??
Super_Hippo Super_Hippo

2019/6/28

#
o.o The last five lines could be executed in the act method. You either need to have a boolean field as as condition and/or set the "timer_message" variable to something when showing the message.
danpost danpost

2019/6/28

#
In this case, you can probably just use:
showText("Level up!", 350, 250);
showText("Zombies will be stronger!", 350, 300);
Greenfoot.delay(60);
showText(null, 350, 250);
showText(null, 350, 300);
Jargy Jargy

2019/6/28

#
thanks :-)
You need to login to post a reply.