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
Delaying actor creation?
By DSP512, with no replies.
How can I delay the creaton of an object in the world? It should be created only once, so its addObject-method is in the world's constructor. But how can I delay this method?
How do you make a image smaller?
By Bean4221, with 1 reply.
Replied to by JetLennit, over 10 years ago:
Go
here
, click "GreenfootImage" then look at the scale() method
Cannot find symbol "canSee"
By Bean4221, with 1 reply.
Replied to by Bean4221, over 10 years ago:
never mind, found it out XD
Stuck! Move object problems , help!
By roidrage, with 3 replies.
Last reply by danpost, over 10 years ago:
IIn the act method of the Truck class, you have this: <Code Omitted>'x' (or 'getX()') is zero when the Truck object is at the left edge of the world.
problems with adding object
By deathburrito16, with 1 reply.
Replied to by davmac, over 10 years ago:
You called the variable 'sherman', not 'Sherman'. You need to use the same name in the reference as you do in the declaration:
getWorld().addObject(
Sherman
sherman, 100, 300);
playing sounds/music in background
By Banjo, with 2 replies.
Last reply by davmac, over 10 years ago:
in the act() method.
Do
not
do that in the act method, or you will end up with the song playing over itself multiple times. Do it the world's started() method, for instance.
Help with changing a Subclasses image
By Eddir, with 4 replies.
Last reply by Eddir, over 10 years ago:
Okay, thanks for your help.
How to write a line of code
By JasonZhu, with 5 replies.
Last reply by JasonZhu, over 10 years ago:
Oh! This works to keep the game continually running after the world is set. I was going to ask how to do keep the scenario running after the world is set because how I was previously setting the world, it failed to run the scenario after it set the world.
Removing objects
By Draymothisk, with 8 replies.
Last reply by JasonZhu, over 10 years ago:
Its read for each Object obj in getWorld().getObjects(Tree.class) then...
Getting number of objects in range?
By DSP512, with 1 reply.
Replied to by davmac, over 10 years ago:
getObjectsInRange(...) returns a List, which has a 'size' method giving you the number of items in the list. <Code Omitted>
Need Help Switching between Players in a Turn-Based Game
By ryanward214, with 1 reply.
Replied to by ryanward214, over 10 years ago:
By the way this code is in the world class, and here is my player class for additional reference:
Button
By pr2alede, with 2 replies.
Last reply by pr2alede, over 10 years ago:
Great that's worked. Thankyou
drawString
By DerAxeEffekt, with 1 reply.
Replied to by davmac, over 10 years ago:
From the documentation:
The baseline of the leftmost character is at position ( x , y )
The problem is that you're drawing the text too high up; it goes off the top of the image.
Enemy isn't spawning
By GreenAnthony, with 3 replies.
Last reply by danpost, over 10 years ago:
davmac wrote...
This looks like a partial bit of code. What method is this? Could you post the whole method? What is line 3 - "ngeSize == 1) " - supposed to be?
I presumed it was in the act method of the EnemyRocket class and line 3 was a cut-off 'if (changeSize == 1)'.
How to create files...?
By GreenAnthony, with 1 reply.
Replied to by lordhershey, over 10 years ago:
check this little example: http://www.justexample.com/wp/write-file-with-printwriter/ you might just be missing the import java.io.* line
725
726
727
728
729
730
731
X