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
Terminal Window
By Darkmauro, with 4 replies.
Last reply by danpost, about 8 years ago:
What is mundo.ka'? where is the code that creates the 'mundo.ka' actor? what does that code look like? where is the variable 'ka' declared in your world class? what is the error message? What does the code to the 'play' method in your 'animator' class look like?
objects not spawning in world
By darkstargamer, with 9 replies.
Last reply by danpost, about 8 years ago:
First, you will need to change the name of some fields. Actually, to make things easier, an intermediate class between Actor and the four object types will be helpful. Add the following class to your project: <Code Omitted>Next, change the GroundBlock class to this:
how make enemy get position of player
By jokhooo, with 1 reply.
Replied to by danpost, about 8 years ago:
See
here
.
Health for Emeny
By KauTC, with 5 replies.
Last reply by danpost, about 8 years ago:
You will need to add a field in the Monster (or Second) class to track bullet hit(s). It could be a boolean tracking previously hit or an int counting each hit (depending on how many hits you are allowing). Are your monsters truly bouncing off the edges? Seems like you may have some issue with that (but, maybe not). Your at world edge offset values are not consistent in the Lattack class. Was that intentional? The 'eatFirst' method can probably be simplified. If nothing else, the last 'if' (line 63) should probably not have the 'else' in front of it and be started on a new line.
Pls help me making a countdown
By Troxter, with 5 replies.
Last reply by Troxter, about 8 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, about 8 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, about 8 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, about 8 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, about 8 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, about 8 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, about 8 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, about 8 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, about 8 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, about 8 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.
313
314
315
316
317
318
319
X