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

2014/5/17

Create a String that disappears when RUN is clicked

cobarr cobarr

2014/5/17

#
Hi! I really need someone's help! I am new to Greenfoot and want to know what an easy way of making a string of text like "drag 'instructions' actor to learn how to play the game" on the screen so that the user can see it before pressing "run". Once "run" is clicked this string disappears. How can I make the MyWorld listen for a click on run and carry out this action without having to make a new actor, just coding within MyWorld?
danpost danpost

2014/5/17

#
There is a World class method called 'started'. It is by default an empty method; but is called when the project goes from a stopped state to a running state when that world is the active world. You can override the method in your world class an have it either remove the instruction actor or clear its image.
1
2
3
4
5
// in your world class
[code]public void started()
{
    // code to clear or remove instructions
}
You need to login to post a reply.