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
Reset Button After Greenfoot.stop
By Davey1999, with 4 replies.
Last reply by Davey1999, over 9 years ago:
Thank you it works!!! I spent hours trying to figure this out!!!
Can't import background image
By dandrei279, with 4 replies.
Last reply by dandrei279, over 9 years ago:
Thanks man! That worked!
SetRotation
By wolfyze, with 2 replies.
Last reply by wolfyze, over 9 years ago:
Wait did I actually write all this even though theres that turnTowards thing... well aren't I an idiot... I'm pretty new to greenfoot so I have no idea how to do that. :( thank you though
Help for a school Game
By Paswalt, with 7 replies.
Last reply by danpost, over 9 years ago:
Paswalt wrote...
When I want to use a method from another class you can simply write Classname.Method() ?
Only for static (class) field -- not for instance fields. Be aware that class fields only reset when the project is recompiled -- not when it is reset.
Can I use the score variable in my world like for example the player scores 1000 points and then enemys stop spawning and a boss will spawn.
You can use 'CopyOfSchusss.getScore()' from ANY class within the project.
And my last question (probably for a long time) I added a powerup (a rocket). The player can sh
World problem
By Hondrok, with 2 replies.
Last reply by Hondrok, over 9 years ago:
Super_Hippo wrote...
You can't use 'label' before the variable is created. Line 8 should be after line 10.
Thaaank you forgot that indentation matters in Java
jumping
By Hondrok, with 6 replies.
Last reply by Hondrok, over 9 years ago:
danpost wrote...
Hondrok wrote...
I tried with getHeight()/2 and it doesn't work. It says that it can't be found.
That is not what I said -- I suggested this:
getImage().getHeight()/2
Oh, it works! Thank you man :D
Collision
By Nosson1459, with 32 replies.
Last reply by danpost, over 9 years ago:
Nosson1459 wrote...
(commented on Sample Platformer) wat does the blue box do
The blue box is just a sample box. You can press the 'h' key to hide the box and have it set what random object it will spawn. When hidden, you can pass through it except when hitting it from underneath, when it will become visible and spawn a random object to collect (I just created a Coin object and changed the image to show what random value was selected). It would be just as easy to have a specific value held by the box and spawn a specific type object when hit. In the sample, you can repeatedly spawn
float
By Nosson1459, with 1 reply.
Replied to by danpost, over 9 years ago:
Nosson1459 wrote...
what is a float, I came across it in the java.util.Random package and I couldn't c wat the difference between nextFloat and nextDouble was
You might want to review
this page
of the java tutorials for the answer to this question.
mousePressed(this) -- deselecting?
By ZoeF, with 10 replies.
Last reply by ZoeF, over 9 years ago:
I did the following in my Map.class extends World No need for the static value as there is only one instance of the Map running at the moment. If need be i can change it to a static value.
BreakOut Counter Crashing
By BigGrosse, with 1 reply.
Replied to by danpost, over 9 years ago:
A lot of code is missing; the classes run into each other as shown; the error message is missing.
Help with including code in question
By calemip, with 7 replies.
Last reply by calemip, over 9 years ago:
Thanks. Got it working. and it makes sense now. I was getting too complicated as well.
getObjectsAt() won't work for me
By theboyl, with 1 reply.
Replied to by danpost, over 9 years ago:
I think you only need change 'Actor' in the first line to 'Wuerfel'. However, if that does not work, try this in place of your first two lines: <Code Omitted>
how do I turn my .jar or .gfar file into a .exe file that I can put on a website?
By LakeOtis, with 8 replies.
Last reply by Nosson1459, over 9 years ago:
You first have to export it as a .jar file then:
Nosson1459 wrote...
LakeOtis wrote...
how do I turn my .jar or .gfar file into a .exe file
You can look
here
.
this post was posted above in this discussion.
problem with counter
By sunshine1, with 1 reply.
Replied to by danpost, over 9 years ago:
It is not enough just to have a Counter object in the world. You need collision detection between the ball and the gates and a reference to the Counter object so that you can call a method on it to adjust its value. If each gate is to score separately (not add to the same score counter), then you need a second Counter object in the world as well. If this is the case, you will need to reply for help on how to assign a counter to each gate.
If Statement Bewilderment -
By Laurence, with 10 replies.
Last reply by Laurence, over 9 years ago:
<Code Omitted> This fixed it somehow, thanks for all the help provided throughout once more!
413
414
415
416
417
418
419
X