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
title screen
By benbec1, with 2 replies.
Last reply by benbec1, over 10 years ago:
Thank you so much my game works now
Destroying two enemies
By Amelfa, with 1 reply.
Replied to by danpost, over 10 years ago:
What the error is saying is that after you hit an asteroid and the bullet is removed from the world, you cannot then try to find an intersecting Enemy1 object. You cannot look for any intersecting object to an object that is not in the world (the bullet was removed). Change line 12 to this: <Code Omitted>This will ensure that the bullet is still in the world when checking for an intersecting Enemy1 object.
Bluej configuration in Eclipse
By DHEERAJ, with no replies.
I have successfully built the ant build configuration of the bluej in eclipse,but if i run the project i am getting the import threadchecker can not be resolved error as shown in the image <Image Omitted> <Image Omitted> Please help me
Counter Points is not updating
By KrystalLo, with 4 replies.
Last reply by KrystalLo, over 10 years ago:
Ah sorry for the late reply, its working. Thank you alot Dan! :D
get another objects rotation and location
By ashjim999, with 14 replies.
Last reply by SPower, over 10 years ago:
First, I'm not entirely sure about this: <Code Omitted>I don't know how you've defined the getDirection method, but simply using cannonbarrel.getRotation() might be easier. If that doesn't fix it, I suspect it's a problem with the precision in movement. Try to use the SmoothMover class to track the position and such (you can import that class into your project from Greenfoot).
NullExceptionPointer
By Link99, with 1 reply.
Replied to by danpost, over 10 years ago:
Just because a project compiles, it does not mean that you will not get any errors. Compiling will catch syntax error (spelling, punctuation and use of symbols) as well as things like accessibility of methods and fields and proper type-casting of elements within the code. But there are some errors that the compiler cannot predict on. These are called run-time errors. In java, these are called "exceptions". Anytime an exception is thrown, it is either caught (by code created specifically designed to detect the error) or it is not caught and the scenario is terminated and a message will be
Roundabout traffic Problem
By Rabe123, with 4 replies.
Last reply by danpost, over 10 years ago:
Rabe123 wrote...
ok but i dont know how i should do it. How can i make a method for the auto that looks if there (on the other radius) is a bus or car without the touching, inRage or Neighbours method ?
I was not suggesting that you not use any of those methods -- I was suggesting that you use one of those methods (most probably the 'getObjectsInRange' method); but only after re-locating the auto to potential future locations. After performing the check, you would move the auto back to where it was moved from, if a collision was found to occur. So, for example, a method to change lane
Accessing variables from other actors
By mattjames, with 12 replies.
Last reply by danpost, over 10 years ago:
Communazi wrote...
Yeah i am getting the same error as SnapDraggen. any other threads that seem to have the right idea?
Guys, you should have seen the following above:
danpost wrote...
You may have to check that 'getObjects(Sharing.class)' does not return an empty list before calling 'getShared' on an element of it.
By not following this you may get an IndexOutOfBoundsException run-time error.
Adding objects to a List
By sengst, with 4 replies.
Last reply by sengst, over 10 years ago:
Thank you very much! You have been a great help.
Resizing an animated GIF
By Communazi, with 4 replies.
Last reply by danpost, over 10 years ago:
Communazi wrote...
Sorry, follow up question. in place of "images" i would use the name of the class (the class acting as a GIF)?
No. You would use it exactly as is. The GifImage class contains a private GreenfootImage array with the name 'images' that holds the individual images of the gif. That is what is being referred to here.
ScrollWorld and GifImage
By MNastasi, with 2 replies.
Last reply by danpost, over 10 years ago:
MNastasi wrote...
How do you import the ScrollWorld and GifImage classes?
The GifImage class can be imported by using the menubar with "Edit>Import class...", selecting the class and clicking the "Import" button. For classes that are not listed there, you will need to download a scenario that contains it. After opening said scenario, you can close it right back up. Then use your windows explorer to select the "ScrollWorld.JAVA" class from that projects scenario folder and copy/paste it into the 'Greenfoot/lib/greenfoot/common' folder. Then it will also be available to import the sam
actor cannot be added into world
By FutureCoder, with 7 replies.
Last reply by FutureCoder, over 10 years ago:
Thanks, it all works now
Changing the image of the Actor when losing health
By KrystalLo, with 40 replies.
Last reply by danpost, over 10 years ago:
KrystalLo wrote...
It's working now! Thank you so much Dan!
I did not get to the last change that could be done to the Bomb class. You can also remove the 'wasITouched' method from the class.
Score table problem
By Juwen, with 3 replies.
Last reply by danpost, over 10 years ago:
Like I said before, I doubt you will want to use the UserInfo class (it is basically broken now anyway); and the Saver class is not needed. What is needed is for you to create a Score object and keep a reference to it in your World subclass. You can also add a method to the class to 'get' the Score object created. Then, the Timer class can get the Score object from the world and set the appropriate times using the 'setScore' method -- one call for each score to be saved.
Checking if there is an actor is at a specific spot in the world
By bleeblob43, with 2 replies.
Last reply by danpost, over 10 years ago:
Instead of adding and removing the Ground objects, you could just have them move themselves when the player is out of range to a new location along the same horizontal or vertical to the next non-ground location (like leap-frogging). To do that, you could have something like the following method in the Ground class called last from its act method:
458
459
460
461
462
463
464
X