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

Comments for BABYgame

Return to BABYgame

smplmarcelosmplmarcelo

2014/11/15

help please it's invalid when i try to compile it in greenfoot getWorld().show("comido" + magdalenaComida,472,505); reply please. Thanks
danpostdanpost

2014/11/15

The method name is not 'show', but 'showText'.
smplmarcelosmplmarcelo

2014/11/15

it's still the same when it's showText the greenfoot says: cannot find symbol - method showText(java.lang.String,int,int)
danpostdanpost

2014/11/15

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.
danpostdanpost

2014/11/15

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).
smplmarcelosmplmarcelo

2014/11/15

Ok Thanks. I'll try using the 2.4 version first and if still not working I'll try the drawstring. Thank you so much. :)
danpostdanpost

2014/11/15

You already have one 'comida' value showing. Are you not able to show another one in the same way? I will look at what you actually have.
smplmarcelosmplmarcelo

2014/11/15

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
smplmarcelosmplmarcelo

2014/11/15

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)
danpostdanpost

2014/11/15

I have never seen that message, "NoSuchMethodError", during runtime. What is now your line 38 in the Bebe class? (copy it and paste it here)
danpostdanpost

2014/11/15

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?
smplmarcelosmplmarcelo

2014/11/15

not yet I'm downloading the 2.4 version I'll leave a comment later if i still have a problem. Thanks
smplmarcelosmplmarcelo

2014/11/15

there's no error now. Thanks :)
smplmarcelosmplmarcelo

2014/11/18

Help in here there's an error here if ( canSee(Hamburger.class)) I'm trying to change the cupcake to hamburger
danpostdanpost

2014/11/18

First, you need to add an image of a hamburger to the 'images' folder of your project. Then you can use 'setImage' on a Magdalena object.
smplmarcelosmplmarcelo

2014/11/19

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?
danpostdanpost

2014/11/19

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).