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
Greenfoot.ask to int in constructor
By TheGoldenProof, with 2 replies.
Last reply by TheGoldenProof, over 8 years ago:
danpost wrote...
You are probably creating the calculator during project reset (when world is first instantiated and before the scenario is in a running state). Try to avoid using
ask
at that time.
Thanks, I figured it out. I changed it to check whether or not a value had been entered or not in the act.
Having Trouble with Space, Counter, and Explosion
By razornale, with 4 replies.
Last reply by danpost, over 8 years ago:
razornale wrote...
I'm still having a error message on line 44 GreenfootImage(); is coming back with an error message of GreenfootImage() has private access in greenfoot.GreenfootImage
Firstly, there is no
GreenfootImage
constructor that has zero parameters. Secondly, you are not yet wanting to create an image -- that is done within the following
for
loop. You may, however, want to declare the variable to hold a GreenfootImage at that time (although that is not mandatory as you can declare it inside the loop where it would be declared each iteration of the loop). You ca
Having issues using something similar to a scanner
By FarEalm, with 1 reply.
Replied to by danpost, over 8 years ago:
What have you tried? What code do you have for your text box? and what code do you have for entering in the numbers? and which part are you currently having issues with? is it the "right-adjusting" of the numbers put to the screen? or something else? You mention a text box (which is a visual object on the screen) and printing to the screen. Would they both be the same "printing to the screen"?
Adding Objects
By Heet_Patel, with 14 replies.
Last reply by danpost, over 8 years ago:
Well, if you wanted to limit the number of bees in the world to, say 50, then you could use: <Code Omitted>
Issues with counters
By Yomi, with 2 replies.
Last reply by Yomi, over 8 years ago:
This fixed the problem, thank you for the help. :)
What does this error mean?
By Navique, with 17 replies.
Last reply by Navique, over 8 years ago:
danpost wrote...
And the error output is ...
Never mind, I fixed the issue. Thank you for your time.
Is it possible to use fonts as icons
By DavranbekRozmetov, with 1 reply.
Replied to by danpost, over 8 years ago:
DavranbekRozmetov wrote...
I was wondering if there is any ways of me getting icons via code, class or font; the same as Font Awesome for HTML., is there anything I can do?
I do not think the java.awt package is supported in HTML5. That would mean the java.awt.GraphicsEnvironment class where you can get all system fonts from would not be accessible in HTML5. It might be possible to find something similar to what you want in the Unicode character set. I found the chess piece images for my
Chess: drag-n-drop
scenario there.
loops
By Miguel.Valdez, with 16 replies.
Last reply by Miguel.Valdez, over 8 years ago:
Awsome, thank you for all your help.
How can I set a border-radius to a rectangle
By DavranbekRozmetov, with 3 replies.
Last reply by danpost, over 8 years ago:
danpost wrote...
(maybe 40x 49)
should read "40x40".
Help with stoping actors spawing to close to another actor
By MrBB, with 3 replies.
Last reply by danpost, over 8 years ago:
MrBB wrote...
it worked perfectly
Actually, I thought about it and was inclined to believe it might favor the corners. So, I tested it out and the tested-approved version is this:
Forces on Objects
By aidanbb, with 11 replies.
Last reply by aidanbb, over 8 years ago:
Thanks
Delete Game?
By jewelcena, with 1 reply.
Replied to by danpost, over 8 years ago:
jewelcena wrote...
I uploaded a game I now want to delete - how do I do that?
Log in. Go to your scenario. Click on
delete scenario
and confirm.
How to align text in a textbox?
By Fatum, with 1 reply.
Replied to by danpost, over 8 years ago:
Fatum wrote...
Basically what the title says. I need to align text in the TextBox to the left, meanwhile by default it has central alignment.
Create two images, one being the text image and the other being the image for the box. Draw the text image onto the box image and set the box image to the textbox.
Need bullets and enemy class...
By IlikeThePrequels, with 6 replies.
Last reply by danpost, over 8 years ago:
IlikeThePrequels wrote...
Its in my bee class should I state my bee1 class code.
Yes -- that is where the rotation of the stinger need to be set from as well as where the code can be modified so that the stingers are not streaming out.
Could anyone explain how to make a bullet and an enemy diasappear when they collide?
By IlikeThePrequels, with no replies.
I've been trying to find a solution but have not found one yet. Here is my code. public void checkCollision() { Actor bee2 = (Actor) getOneIntersectingObject(Bee2.class); if(bee2 != null) { getWorld().removeObject(bee2); } if (isTouching(Stinger.class)) { getWorld().removeObject(this); return; } } This code causes the bullet to hit the enemy and make it disappear but the bullet continues on traveling until it reaches the end of the world.
270
271
272
273
274
275
276
X