This site requires JavaScript, please enable it in your browser!
Greenfoot
Username
Password
Remember Me?
Sign Up, Lost Password
Activity
About
Documentation
Download
Discuss
Scenarios
Discussions
You need to login to take part
Current Discussions
Object floating above my platform and not touching
By Jochends, with 2 replies.
Last reply by Jochends, almost 9 years ago:
Thanks, That helped!
Greenfoot.playSound() vs GreenfootSound play() method
By hans.vandenbogaerde@gmail.com, with no replies.
In the piano-case from the Greenfoot book chapter 5 (1st edition, in Dutch), it would be normally be wiser to instantiate a GreenfootSound object once, reading the wav-file just once as in sound = new GreenfootSound("3a.wav") and then playing the sound as much as desired with sound.play() opposed to executing Greenfoot.playSound("3a.wav") over and over again. But, in fact, it seams that exactly the opposite is true: Greenfoot.playSound("3a.wav") performs clearly better than sound.play(). This is counter-intuitive! How come?
Finally was able to produce a code that makes a vacuum sense dust, but now it gets stuck under barriers. What to do?
By thebruus, with 1 reply.
Replied to by danpost, almost 9 years ago:
thebruus wrote...
Finally was able to produce a code that makes a vacuum sense dust, but now it gets stuck under barriers. What to do?
Question: what are lines 56 through 59 supposed to do? It appears you want to move the Roomba object toward a Barrier object, if one is below it.
Checking if there is an object
By LimeLava, with 5 replies.
Last reply by LimeLava, almost 9 years ago:
Never mind
Trying to display score on Goldfish actor wherever it is located
By JWK3986, with 1 reply.
Replied to by danpost, almost 9 years ago:
You may have to save the location where you originally had shown the score. That way, you can remove it using 'null' for the string and update the location when showing the new score: <Code Omitted>
types
By Nosson1459, with 1 reply.
Replied to by danpost, almost 9 years ago:
Nosson1459 wrote...
<Code Omitted>This code worked and then in middle of nowhere it said incompatible types actor cannot be converted to Box. Why not and why did it work before, when I didn't change anything, and I can't change the "Box box" to "Actor box" because then I cant access "isThere" .
You just need to let the compiler know that the returned object of 'getOneObjectAtOffset' is indeed a Box object. The method is designed to return an Actor
Side-scrolling
By Nosson1459, with 9 replies.
Last reply by danpost, almost 9 years ago:
Nosson1459 wrote...
How do you set where you can, and can't see?
What kind of side-scroller are you trying to create -- one that scrolls continuously regardless of any actor in the world or one that follows a specific actor? I will presume that this is for your Pengu project, in which case it follows an actor and scrolling occurs when the actor has passed a specific limit toward the right only. That is, no matter how far pengu is allowed left, no scrolling will occur (pengu would just be limited to some nominal x-coordinate value). So, anytime the world "sees" that pengu is on the ri
Help with Math.Pow and doubles.
By Chip, with 3 replies.
Last reply by Chip, almost 9 years ago:
Cheers for your help guys , sorry I didn't replay sooner, I was away for the weekend :)
font
By Nosson1459, with 1 reply.
Replied to by danpost, almost 9 years ago:
Nosson1459 wrote...
how do I set a font other than the reg. greenfoot one??
You cannot programmatically change the font used by the World class method 'showText' or the GreenfootImage constructor 'GreenfootImage(String, int, Color, Color)'. However, my
TextImage Support Class
scenario can be studied or the TextImage class from it can be used directly to create TextImage objects (which ARE GreenfootImage objects) when the class is included in your project.
nullPointerException
By Nosson1459, with 4 replies.
Last reply by Nosson1459, almost 9 years ago:
thnx
move
By Nosson1459, with 3 replies.
Last reply by danpost, almost 9 years ago:
Nosson1459 wrote...
but I want it to door 2 override move that is if door ==true and x>342 move should = false
Then change line 50 of the Pengu class to this: <Code Omitted>
Switch to the hitting animation and back to normal
By theotherroom, with 2 replies.
Last reply by theotherroom, almost 9 years ago:
Thank you, it worked!
Trying to display points on actor
By JonnyB7, with 1 reply.
Replied to by danpost, almost 9 years ago:
Try replacing line 36 of the Goldfish class with this: <Code Omitted>
Trying to use a list to affect pears when my block hits a world edge
By JWK3986, with 7 replies.
Last reply by JWK3986, almost 9 years ago:
ok, everything executed properly when I added "pear." in the appropriate spots. Thanks a lot for the help.
Please help with java.lang.IllegalStateException: Actor not in world. An attempt was made to use the actor's location while it is not in the world. Either it has not yet been inserted, or it has been removed.
By powderbanana, with 1 reply.
Replied to by danpost, almost 9 years ago:
After line 26 in the Balloon class (where you are removing the balloon from the world), add a 'return;' statement so execution of further statements in the method are not attempted.
428
429
430
431
432
433
434
X