This site requires JavaScript, please enable it in your browser!
Greenfoot back

What is happening right now?

danpost

reply to game levels

By danpost - 3 minutes ago
Please note what line 7 says about where lines 9 and 10 should go.
danpost

reply to Help, im a noob!

By danpost - about 3 hours ago
To remove the error, change line 13 to this: <Code Omitted>which ensures the actor is still in the world before checking world edges. To also remove the asteroid collided with, insert the following at line 8: <Code Omitted>
lordhershey

reply to Iframe Greenfoot game to present on my own site?

By lordhershey - about 3 hours ago
Is this the 666 days in hell game? You could probably figure out what the jar name is and pull it out, copy the applet tag and there you would have it. Diggin at the game page the jar file can be downloaded www.greenfoot.org/applet_attachments/0002/7925/greenfoot6619984432213746490.jar and the html code you will need to load it is on the page source as well: <applet code="greenfoot.export.GreenfootScenarioViewer.class" width="818" height="670" archive="Hosted Path/greenfoot6619984432213746490.jar" </applet> Not 100% sure if that will work. but looking at that jar looks like it has all classes and and assets in there.
danpost

reply to Getter/Setter methods in Superclass

By danpost - about 3 hours ago
getreides wrote...
How would one write a super method like getX() or setLocation()?
Those methods are already super methods located in the Actor class and can be used for any object created from any subclass of Actor.
how would one write a super method that references/changes the fields of the respective subclass?
A non-private field declared in a super class is given to all objects created from its subclasses. A non-private method in a super class can be called on any object created from its subclasses. Do not re-declare the fields declared in a superclass in its subclasses -- a method cannot change any field declared in one of its subclasses.
danpost

reply to Whats Wrong?

By danpost - about 4 hours ago
The main thing that is wrong is that you cannot pass more than one actor to the 'removeObject' method (see line 2). The only thing you want to do if either condition in line 1 is true is remove the shot. This means that if colliding with an asteroid, the asteroid should be removed within the method that checks for its intersection:: <Code Omitted>