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 chapter 5 add text
By Tim1234, with 6 replies.
Last reply by Tim1234, about 11 years ago:
It's working now. Thanks.
counter class
By DoctorProfessorYoshi, with 6 replies.
Last reply by Jonas234, about 11 years ago:
can you post the whole code ?
Problem about setColorAt & getColorAt method
By Upupzealot, with 15 replies.
Last reply by davmac, about 11 years ago:
Because it might be slower. Greenfoot uses what the system gives it.
No Keyboard-Reactions after exporting to Webpage
By TheoHeusser, with no replies.
Hi, can anyone imagine what went wrong. Pupils constructed a simple game (run away from spiders which are always following you; the player uses the arrow keys to seepd up or down or change direction of movement). Within Greenfoot the game worked fine. But after exporting toa webpage and starting the html-file, there is no more control via the arrow keys! (some Browser won't seven start the game.) GF 2.2.1
Report 2 Bugs of Greemfoot 2.2.1
By Upupzealot, with 7 replies.
Last reply by Upupzealot, about 11 years ago:
@davmac I can't reproduce the inner class problem also, but you can find that even the inner class is deleted from the source code, the compiled classes files was still in the project folder. And you are right, "test/board.jpg" works good, but "/test/board.jpg" only works in Greenfoot. MayI ask why?
Bouncing balls at corresponding angles
By Phytrix, with 3 replies.
Last reply by Phytrix, about 11 years ago:
Great. Thanks.
Need Help Please. When i compile this it will say not a statement.
By Zaraki, with 1 reply.
Replied to by danpost, about 11 years ago:
One thing is that by naming your bullet objects with numbers, you are probably confusing the compiler (naming convension has variable names start with lowercase letters only). Another is that you do no have a field name for the bullet created in the else portion of the code.
Loading an image within a circle
By mattrayner, with 3 replies.
Last reply by robg, about 11 years ago:
For anyone that comes across this looking for the same thing, take a look at our solution here ->
Image within a circle
Solution Outline
- Created a new BufferedImage & got the Graphics2D object (The same size as the orignal image - Drew the Elipse that we wished to crop by. (In white) - Changed the Composite of the image to AlphaComposite.SrcAtop to allow us to clip any further drawing to the elipse. - Drew the original BufferedImage onto the new one Make sure to use the correct type when creating the BufferedImage, if you
Repeat Until?
By saskekun95, with 1 reply.
Replied to by danpost, about 11 years ago:
You do not need seperate methods for 'downwards' and 'upwards'. All you need is to 'turn' the actor when the proper conditions are met. The conditions to turn around at the top of the screen are (1) the y-coordinate of the actor is zero and (2) the rotation of the actor is 270. The conditions to turn around at the bottom of the screen are (1) the y-coordinate of the actor is one less than the width of the world and (2) the rotation of the actor is 90. When either set of conditions is true, turn the actor around 180 degrees.
java.lang.nullpointerException-Error
By Mepp, with 6 replies.
Last reply by davmac, about 11 years ago:
That means that 'spf' is null. It is the same problem - you are calling a method on a null reference.
HELP! Is it possible to blend classes?
By sopi, with 5 replies.
Last reply by danpost, about 11 years ago:
What I see is a class with a Counter object called 'counter' that is never anything but 'null'; and, if the public method 'activate' is ever called, will cause a NullPointerException.
atWorldEdge Method
By ar_jay0525, with 2 replies.
Last reply by Phytrix, about 11 years ago:
It'd seem that the method doesn't exist. You can use the following code for an atWorldEdge method. Replace the 10s as you wish. Generally, people want objects to bounce when the edge of it hits the very borders of the world, so I'd recommend replacing the 10s with half of the size in pixels of your image. public boolean atWorldEdge() { if(getX() < 10 || getX() > getWorld().getWidth() - 10) return true; if(getY() < 10 || getY() > getWorld().getHeight() - 10) return true; else return false; }
Can't call method from world class in actor class
By ycart, with 2 replies.
Last reply by danpost, about 11 years ago:
I am quite sure that the 'startMission' method IS working. It is only called
once
after the mouse click. Each method it calls will run
one time
. Therefore, you will have a 1 in 300 chance of one Food object appearing; a 1 in 600 chance of one Treasures object appearing; and, a 1 in 100 chance of one Person object appearing. You would be very lucky to have anything appear, which is why it seems like it is not working. I think what you wanted is that these object randomly, but continuously, appear throughout the game. In order to accomplish this, you will need a boolean fie
stops game
By aananon, with 6 replies.
Last reply by danpost, about 11 years ago:
What you need to do is either control the rotation of the object so that the call to the 'move' method will move the object in the proper direction or keep track of the speed of the object in both the x and y directions. With either method, the proper adjustments to the rotation or value of the variables are needed when the object hits the walls.
Help with exporting problem
By BradH, with 5 replies.
Last reply by BradH, about 11 years ago:
oh no sorry, i was just wondering if anyone on this website could help, nothing to do with greenfoot.
867
868
869
870
871
872
873
X