i want to use two tags one is "score" and the other "time left". The first tag is "score" and the second one is "time left". but the prob is that both the tags are named as "Time left" while execution.
I m using:
setImage(new GreenfootImage(" Score: "+score+ " ", 30, Color.BLUE, Color.BLACK, Color.GREEN));
setImage(new GreenfootImage(" Time left: "+time+ " ", 30, Color.BLUE, Color.BLACK, Color.GREEN));
Help plz.
So you have one actor which you want to display both? Or you have two actors and one should display the score and the other the time? (You said "both tags are named as "Time left"" which means for me, that you have two actors.)
If you have two actors, one actor should get one line, and the other gets the other line.
If you have only one actor, I think you can use
" Score: "+score+ "\n" + " Time left: "+time
to display it in two lines. But I never tried to use a GreenfootImage with more than one line, so I am not sure if this will work.
Usually, I would have one actor to display one, and another one to display the other.