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
My code broke?
By arw90, with no replies.
This morning I tried to compile my code but a got the error message: "cannot find symbol - method mouseClicked(Credits)" I did nothing to change that I have no idea why it is not working, here is my code: <Code Omitted> Last night on my mac I enabled the tap to click option and this morning when I tried to compile I did get an error from the terminal. I looked it up on google and found the problem was relating to the mac mouse pad , I thought that maybe the sudden change to tap to click was the problem so I quickly reverted my mouse pad options. That error no longer pops up in the terminal but still my code won't compile. I think my code is permanently broke because of that tap to click option, can anyone verify this? This issue is in every class that has that method in it.
Objects
By ironphoenix20, with 4 replies.
Last reply by danpost, almost 11 years ago:
fejfo wrote...
what danpost means with 4 is use "addObject(" in the world
Actually, what I meant was to look over the code, compare it to what actions you had taken before saving the world and learn from that comparison.
Calling actor from another class?
By GodOfAllTime, with 3 replies.
Last reply by danpost, almost 11 years ago:
mik wrote...
In this case, you don't actually need to check the 'hasKnife' boolean at all. If the ThrowingKnife act method executes, then obviously the ThrowingKnife exists. And if it exists, then the player must have had it before (otherwise you would not have created it).
That would be true if the knife was still to begin with so the player can pick it up. The knife is going to need to work in two different states, an unthrown state and a thrown state. This can be done simply by adding an int speed field to the class initially set to zero. When thrown, the value can be changed so t
World Background
By ironphoenix20, with 6 replies.
Last reply by ironphoenix20, almost 11 years ago:
Thanks! That worked!
Must I use Greenfoot with a bundled JDK now?
By Upupzealot, with 1 reply.
Replied to by mik, almost 11 years ago:
Yes, Greenfoot is now distributed only as a bundled package. If you already have a JDK, this is no problem: You can have additional JDKs executing without any issues. Having the JDK bundled guarantees that Greenfoot and the JDK it uses always fit together: It ensures that your JDK is not too old when you install, and it makes sure that if you update your existing JDK, Greenfoot continues to use the one that it was built for and tested with.
help pls when score hit 500 add boss.
By ggtamilggt, with 1 reply.
Replied to by fejfo, almost 11 years ago:
<Code Omitted> so just check if it went over 500 by adding and then spawn a boss
Why doesn't this boolean work?
By SonofArith, with 2 replies.
Last reply by danpost, almost 11 years ago:
Another thing is that you need to compare the value of 'hasKnife' to 'true' or 'false', not assign 'true' and 'false' to the field as you are within the 'if' conditional expression. Use '==' for comparing; '=' is for assignment operations.
How to get a variable from an actor class to a world class
By Brookili, with 4 replies.
Last reply by Brookili, almost 11 years ago:
I tried this and it worked, thank you so much!
Help on making a message appear when something is hit, but then disappears afterwards
By 16cruzs, with 4 replies.
Last reply by danpost, almost 11 years ago:
Add to the TempMessage class: <Code Omitted>
Adding an enemy after food is eaten
By supersmashmemes, with 3 replies.
Last reply by supersmashmemes, almost 11 years ago:
That helped! Thanks a lot!
Help me! Spawning random object
By mabzstarr, with 3 replies.
Last reply by danpost, almost 11 years ago:
mabzstarr wrote...
... but the end result is the same as the code you have suggested whereby the object spawns at a random location every time project is reset. Does it really matter or they the same. Thanks
They are essentially the same.
How to get one object to follow another?
By Jnrichards, with 12 replies.
Last reply by davmac, almost 11 years ago:
(2) the list holds an int value indicating how many elements it contains and 'isEmpty' would check for a zero value while 'size' would just return the value. The only difference would seem to be where the comparison was made (in your code or within the method called).
In practice, this is usually true. In theory, a List implementation using a linked structure doesn't actually need to keep the size in a variable - so the size() method might actually have to count the nodes, whereas isEmpty() can just check whether there is any node. (Not storing the list size can make certain
How to tell what key was pressed?
By SonofArith, with 4 replies.
Last reply by SonofArith, almost 11 years ago:
danpost wrote...
Okay, instead of the 'moving' field, use a class GreenfootImage field to hold the standing image and create an image from it with the same rotation as the moving images:
Change Variable of Another Actor
By Woollen, with 1 reply.
Replied to by danpost, almost 11 years ago:
Assuming a Whatever actor is in the world: <Code Omitted>
Non static variable cannot be referenced from a static context
By jig27, with 1 reply.
Replied to by danpost, almost 11 years ago:
Line 82 of the Asteroid class is trying to reference 'target' from the class instead of from the object of the class. Your class name is 'Counter' and line 81 assigns the object to a reference variable named 'counter'.
516
517
518
519
520
521
522
X