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
Having problem with returning int.
By shadowsknife, with 1 reply.
Replied to by danpost, over 7 years ago:
The
getCount
method is not in the
World
class -- but in a subclass of
World
. You must inform the compiler which type of world it is in. For example, if the subclass is named
MyWorld
, then: <Code Omitted>Note that the
getWorld
method of the
Actor
class returns a
World
object (or
null
), which could potentially be of any subclass of
World
.
Need help with a school project
By dmumby6@gmail.com, with 1 reply.
Replied to by danpost, over 7 years ago:
Yes -- it is possible. No further help can be given with the limited information given (detail on game structure and what you are currently having difficulties with).
Using I/O File in Jar ends with FileNotFoundException
By Vesuv, with 2 replies.
Last reply by davmac, over 7 years ago:
Oh - and you won't be able to update the file using that method. If you really want to keep high scores persistent, I suggest looking into the Java Preferences API. There's a brief tutorial
here
.
Exported to jar - Game freezes when changing World
By Vesuv, with 5 replies.
Last reply by Vesuv, over 7 years ago:
Vesuv wrote...
I found the Problem. stupid me. I had a mistake in a different class, which I was sure would work 100%. Never trust your writing! <Code Omitted>
But thanks. :)
Image .PNG problem
By virtus, with 1 reply.
Replied to by Super_Hippo, over 7 years ago:
Seems like the name you use in your code is not the same as the name of the file (
RIGHT
vs.
Right
)
Anti-Gravity
By Venbha, with 4 replies.
Last reply by Super_Hippo, over 7 years ago:
Like this?
How... Please help
By Venbha, with 3 replies.
Last reply by Venbha, over 7 years ago:
So it
is
possible.
Need help getting a projectile to change direction with an Actor
By woopersnaper, with 2 replies.
Last reply by danpost, over 7 years ago:
There is also an issue with a stream of bullets instead of individual ones (a new one will be create for each act cycle the space key is held down. You will need a boolean field to track the state of the space key:
Taking the Private Variable of an actor, once clicking on it.
By Hyperbaba, with 1 reply.
Replied to by danpost, over 7 years ago:
(1) you should avoid using 'static' variables and method unless you need to retain a value during a scenario reset (like for a session high score, for example); (2) lines 15 and 121 are problems in that the will be set to values prematurely; these line are set when the object of their respective classes are created and do not automatically update; remove those lines and get the values from within the act method when needed; It would be easier to check for
Actor
object clicks in your
MyWorld act
method. You could start with the following classes:
I am having a serious problem with my animations.
By CosmicCaleb, with 4 replies.
Last reply by danpost, over 7 years ago:
Hippo is correct about what the line should be. You should have been getting an error without the correction since you are not using a "ka0.png" image.
fatcat scenario - issue of being unable to inherit the value of a public variable in subclass MyCat, inside the walkLeft and walkRight method call parenthesis
By parthjuthani, with 4 replies.
Last reply by danpost, over 7 years ago:
parthjuthani wrote...
So, in the super class MyCat, there should be 10 instead of 'int distance'?
There should be something that has a specific value. It could be a literal constant (like '10' is) or it could be a variable (with a pre-assigned value) or it could be a method call that returns a value of the appropriate type (int, in your case) or it could be an expression that evaluates to a value of that type. At any rate, you supply the distance that you want it to move.
non static method cannot be referenced from a static context.
By Joey1994, with 1 reply.
Replied to by danpost, over 7 years ago:
The is a series of problems with how you are trying to add worms into the world during game-play. First, in the
wormToevoegen
method, you have this: <Code Omitted>Line 2 creates a variable to hold a
Worm
object; then, line 3 assigns its value to itself (more of a fact than a command) -- its value remains
null
. Line 4 then tries to call method on a non-existent (null) worm. Let us now assume you had created a worm and assigned it t
JAVADOC - Commented methods not showing up in the documentation.
By MayorWolf, with 1 reply.
Replied to by MayorWolf, over 7 years ago:
SOLVED: The methods must be public!
Increasing the size of the bubble by 10
By gsingh87, with 14 replies.
Last reply by danpost, over 7 years ago:
gsingh87 wrote...
What code should I use to increment the size of the bubbles by 10 every time
Initial size plus 'a' times 10.
No Buttons Pressed
By CosmicCaleb, with 5 replies.
Last reply by CosmicCaleb, over 7 years ago:
Exactly! Thanks so much!!
237
238
239
240
241
242
243
X