I think you need Greenfoot version 2.4 to use it. If you are not using the latest version, then you need to create an Actor subclass and set a Greenfoot image of the text you want to display to it. You will need a method to change the image when the value of 'comida' changes.
As an alternative, you could use the 'drawstring' method on the background image of the world. However, you will have to replace the background image each time the value of 'comida' changes (to remove the old string -- so you can draw the new one -- so you will not end up with string over top of string).
i'm using a 2.3 version i can run the game but if i hit a cupcake a there will be a message that will pop out. and there's no comida value that will show in the lower left and right of the game because of the error on the showText
when i hit the cupcake in the greenfoot app it says:
java.lang.NoSuchMethodError: greenfoot.World.showText(Ljava/lang/String;II)V
at Bebe.buscaMagdalena(Bebe.java:38)
at Bebe.act(Bebe.java:17)
at greenfoot.core.Simulation.actActor(Simulation.java:568)
at greenfoot.core.Simulation.runOneLoop(Simulation.java:526)
at greenfoot.core.Simulation.runContent(Simulation.java:215)
at greenfoot.core.Simulation.run(Simulation.java:205)
Also, this part looks very strange -- (Ljava/lang/String;II)V
I wonder if you got a good download on the new version. You did download Greenfoot version 2.4 and are now running it, correct?
It's ok now thanks :). can i ask another question about the codes that we should use to transfer to another level or world after this level is finished?
Yes, but please do so by creating a new 'Discussion' thread. Thee, code posts are easier to view and reference; also, others may benefit by seeing how to correct their similar problems (plus, your scenario page does not get filled with a bunch of comments that deal with bit and pieces of the scenario, instead of it in general as a whole).
2014/11/15
2014/11/15
2014/11/15
2014/11/15
2014/11/15
2014/11/15
2014/11/15
2014/11/15
2014/11/15
2014/11/15
2014/11/15
2014/11/15
2014/11/15
2014/11/18
2014/11/18
2014/11/19
2014/11/19