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
Pls help me making a countdown
By Troxter, with 5 replies.
Last reply by Troxter, almost 9 years ago:
danpost wrote...
Lines 20 through 22 instantly depletes the timer value. Using 'while' there prevents the timer from counting act steps. The setting of the speed of the scenario should be done at the time the world is being created (in your world constructor). It may not (or it may) matter that all fish2 objects will be invulnerable at the same time due to 'e' being static. It may not be necessary to have the 'e' field as all it does is inform that the timer value is not zero (which can be checked directly). The less fields you use, the less complicated, less confusing and less error-prone
wie kann ich meine Scenario herunteladen?
By akhavariii, with 1 reply.
Replied to by Super_Hippo, almost 9 years ago:
Click "Export" (or "Teilen" in the German version) in the top right corner in your Greenfoot program to upload your scenario. (Why is the question in the title asking the opposite?)
Spawning Mobs wave by wave
By KauTC, with 3 replies.
Last reply by danpost, almost 9 years ago:
KauTC wrote...
how to write the code so that the mobs will spawn when your score = 5
<Code Omitted>
JFrame not showing
By divinity, with 6 replies.
Last reply by danpost, almost 9 years ago:
I really do not believe that you should make your JFrame runnable. Runnable allows your object to run its own code; but, it really does not have any of its own to run. It is constructed; it acts upon actions performed on it (clicking a button, entering data, etc) and provides some desired result. The actions taken by the user causes some specific code to execute; but there is no behind-the-scene stuff that would have your JFrame do something without some action by the user. Specific to the code above, 'initComponents' is called when a Login object is created. It does not make any sense
Make enemy detect position player
By ebhiy, with 1 reply.
Replied to by danpost, almost 9 years ago:
I would find out if the player was in range using 'getObjectsInRange' before trying to get its location coordinates. I am not sure why you created those methods in the player class. You can call 'player.getX()' actually easier than calling 'player.getnilaiX()'.
3.1 caused a lot of troubles
By Klumb, with no replies.
Hello this is a rant on the 3.1 update. This update was supposed to be seamless but with one of my project it was really annoying. the first annoying change was the suppression of the fillShape() method. I have a method that creates some polygons and another method that draws them. now the first method needs to return a int instead of a Polygon, or I need to use fillPolygon(poly.xpoints,poly.ypoints,poly.npoints) instead of fillShape(poly). In either case the code is less clean and readable. the second problem was with the greenfoot.Color it wouldn't cause any trouble if it had all the methods that java.awt.Color proposed and if there was a way construct a greenfoot.Color from a awt Color. But there isn't so I had to add the methods myself in a subclass
WorldEdge cannot work help !
By KauTC, with 8 replies.
Last reply by danpost, almost 9 years ago:
danpost wrote...
If spawning your wave near the bottom, use 'getHeight()-2' (or less) for the y-coordinate of the spawning location.
This was meant in reference to your preparing of the world -- where you add the new actors into the world.
getting variable form world to actor
By NielsV5B, with 8 replies.
Last reply by NielsV5B, almost 9 years ago:
Thanks, that was indeed the problem.
How to stop the game when the crab dies?
By PikaCode10, with 1 reply.
Replied to by danpost, almost 9 years ago:
By deleting previous attempts,, you have not allowed yourself the opportunity to see where you went wrong. Also, you have lost the ability to show any effort. Pity! Re-try, and if failed again, show what you had tried.
Greenfoot Key Bindings
By bufuu, with 4 replies.
Last reply by bufuu, almost 9 years ago:
ok, nice :) I was just wondering if I was the only one suffering and if I cozld change it eassily.
Need explanation GetX and GetY???
By RTFM, with 2 replies.
Last reply by danpost, almost 9 years ago:
RTFM wrote...
could someone translate this in "words" ?
In one word -- "wrap". At least, that is the idea. (but, I guess that is translating it in "word") 1st if: when at right edge of world, teleport to left edge; else: when at left edge of world, teleport to right edge; 2nd if: when at bottom edge of world, teleport to top edge; else: when at top edge of world, teleport to bottom edge.
Problem with ?-: instead of if-else
By Super_Hippo, with 19 replies.
Last reply by danpost, almost 9 years ago:
Super_Hippo wrote...
Oh right, how couldn't I notice that... the result is still 60.0, but it works when adding the (int) in the second part
Ahh -- you must have 'tkt' as a 'double' type field. Looking back, I do see you referring to its values as '1.0', '2.0', '3.0', etc. I was using it as an 'int' type field above.
Own class in the helper class folder
By wueschn, with 8 replies.
Last reply by danpost, almost 9 years ago:
nccb wrote...
Try deleting this line from about line 6 in your HTML file that won't display: <Code Omitted>
That does the trick. Thanks.
How do you add a step counter
By Pimissuper1, with 9 replies.
Last reply by Super_Hippo, almost 9 years ago:
<Code Omitted>
XML file compatibility on JAR files
By lapickett, with 9 replies.
Last reply by davmac, almost 9 years ago:
I would not bother with that until the capability of using that storage with HTML 5 is ever resolved.
I am not sure I understand this conversation. What is this "preferences"? Is that different from UserInfo storage? The latter should work fine with HTML5. (But, I'm not sure it's suitable for lapickett's needs here).
315
316
317
318
319
320
321
X