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
cannot remove intersecting object
By taikvcing, with 5 replies.
Last reply by danpost, about 9 years ago:
Looks like a 3-d issue. Try having the crusher remove the brick when the crusher is down to a certain point instead of using solely collision detection. You can use the height of the brick as the amount of distance the crusher is to the platform to determine when the brick is destroyed.
JFrame
By Nosson1459, with 14 replies.
Last reply by Nosson1459, about 9 years ago:
Everything works, but that is because I put it like this:
creating javadocs for scenario
By freddyhard, with 3 replies.
Last reply by freddyhard, about 9 years ago:
This is going back! What i did afterwards was open the project in Eclipse. There were loads of errors, but all i wanted was to get the documentation which Eclipse produced nicely - that might be of some use to you?
Why can't I reload delay count?
By Astralman, with 9 replies.
Last reply by danpost, about 9 years ago:
If the 'reloadDelayCount' does what I think it does then something like this: <Code Omitted>
Need help spawning pigs randomly
By cdaawgcodeboi, with 2 replies.
Last reply by danpost, about 9 years ago:
Start with a method to spawn a pig (in your World subclass): <Code Omitted>Now, you can call it when needed. For example, if you want to occasionally spawn one and limit the number of pigs in the world to, let us say,
Codes for the timer
By lolitsme, with 1 reply.
Replied to by danpost, about 9 years ago:
lolitsme wrote...
Hi! I am planning to have a timer in my game, does anyone of you know the codes? thank you in advance!!
There are different ways to "time" events. One uses the number of act cycles and another uses the system clock. The system clock should only be used when real-time is critical. To determine which is better in your case, be specific and describe exactly what the timer is going to be used for. Also, indicate at what times, if any, the value of the timer is to be displayed.
Detecting Platform Glitch
By gmacias, with 1 reply.
Replied to by danpost, about 9 years ago:
When an object is encountered when moving vertically (as well as horizontally, by the way), the position of the actor needs to be adjusted so that it is not constantly "in" the object. Use the value (sign) of 'vSpeed' to determine if the encounter was a head bump or landing on feet. Then you will know where to position the actor with respect to the encountered object.
Greenfoot not working
By LakeOtis, with 2 replies.
Last reply by danpost, about 9 years ago:
Can you please show and example of a project that will not compile -- the World subclass of the project. HOW TO: open your windows browser and select the project folder. Find the JAVA file that is the initial World subclass and open it in a text editor. Then you can copy/paste the code here. If you cannot find the JAVA file in the folder, then list the files you do see and give the type of each file here.
Bounded moving in tilebased world
By katenech, with 1 reply.
Replied to by Super_Hippo, about 9 years ago:
Why did you create a new discussion here?
Reference method from a world in a separate world
By Samas, with 3 replies.
Last reply by Super_Hippo, about 9 years ago:
Oh sorry, I didn't see that Iron1 is a world class... Maybe this could work then: <Code Omitted> You could also add a new constructor: (or just change it to it if your scenario does not start in the IronManMode class) <Code Omitted> And then, you could use the following instead of the first code:
Window moves to side of screen on opening
By jcw, with no replies.
I am opening Greenfoot up and the window immediately moves jumps over to the right side of my screen. Any ideas why this is happening?
Spawn in fixed location??
By Nomabear, with 1 reply.
Replied to by Baguette, about 9 years ago:
Try something like this? <Code Omitted>
NEED HELP
By ivo295, with 1 reply.
Replied to by Super_Hippo, about 9 years ago:
You create a new 'count' variable each time the act method is executed. You might want to create 'count' (or maybe with a more obvious name) like this instead: (outside methods) <Code Omitted>
Little Crab Ch 4.7
By mkirkendall, with 1 reply.
Replied to by Super_Hippo, about 9 years ago:
It says "to this variable" so I guess there isn't a 'sum' variable. You just use children=daughters+sons as this "assignment statement".
Error in execution of code
By ZoeF, with 1 reply.
Replied to by Super_Hippo, about 9 years ago:
If the object is removed from the validateLocation-method, the act method will still finish executing (and giving you the error because it can't find objects in range if it isn't in the world). You could make the method return a boolean and if it is false (= the object was removed), you exit the act-method. As an alternative, you can just check if the object is still in the world after you called the method.
424
425
426
427
428
429
430
X