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

2018/10/30

What is the meaning of prefix?

MB12345 MB12345

2018/10/30

#
1
2
3
4
5
6
7
8
public Counter(String prefix)
    {
        background = getImage();  // get image from class
        value = 0;
        target = 0;
        this.prefix = prefix;
        updateImage();
    }
danpost danpost

2018/11/4

#
MB12345 wrote...
What is the meaning of prefix? << Code Omitted >>
prefix is the label you wish to give to the value the counter is to display. Some possible examples "Score: ", "Worms Eaten: ", "Level ", "Time remaining: " etc. The prefix is displayed, as a label, in front of the value.
You need to login to post a reply.