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
Variable Weights Help
By JMoller, with 35 replies.
Last reply by JMoller, almost 13 years ago:
so, my second question is how would incorporate this code with gravity to make the object fall since that not working either so i found out........
Lists, am I doing it right?
By darkmist255, with 3 replies.
Last reply by darkmist255, almost 13 years ago:
That second post looks great (I'll try to remember that for the future) but for the moment I like the idea of keeping track of the key positions themselves. Thanks very much though, keystroke checking should be much easier now :D.
Removing characters from a string?
By darkmist255, with 6 replies.
Last reply by darkmist255, almost 13 years ago:
Ah, the info on string manipulation was very helpful, as with the advice! Although toCharArray would work I'll go the proper way and learn how to manipulate strings properly (seems straightforward upon just reading over it). Very helpful guys, thanks! I'm really getting into data manipulation, arrays, lists, etc.
stopping action
By Matt, with 3 replies.
Last reply by danpost, almost 13 years ago:
What you need to do, I believe, is add a boolean field to the world class, call it 'waitingForClick', and set it to 'false'. Then in all your actor classes, and the world class, use it to control what gets executed and what does not. In an actor class (let us say the name of your world is 'MyWorld'): <Code Omitted>or
Timer, remove object
By Matt, with 1 reply.
Replied to by danpost, almost 13 years ago:
Create a new class called 'TimedMessage' using the code provided below. Call it from the world class with this: <Code Omitted>The '1000' can be adjusted to increase/decrease the time it is displayed
Removing an actor on Click :)
By Matt, with 1 reply.
Replied to by SPower, almost 13 years ago:
In the act() methodo WIN, add this if statement: <Code Omitted>
make a dialogue/text box load from .txt
By Andriyanto, with 2 replies.
Last reply by Andriyanto, almost 13 years ago:
oh yes, i don't understand about it.. i want make a dilogue after dialogue1 appear, iam klik then dialogue2 appear..so iam make if (runningStory) and storyTime..but it doesn't work..please help me.. this is my code class Text.. import greenfoot.*; // (World, Actor, GreenfootImage, and Greenfoot) import java.awt.Color; import java.awt.Font; import java.io.IOException; import java.io.BufferedReader; import java.io.InputStream; import java.io.InputStreamReader; import java.net.URL; import java.util.StringTokenizer; import java.util.ArrayList; public class Text extends Act
Scoreboard Counter
By fergo2012, with 2 replies.
Last reply by danpost, almost 13 years ago:
You could let the new Scoreboard object know what score to display when you create it -- new Scoreboard(score). Just need to create a constructor that accepts the int value. -- public Scoreboard(int finalScore). If the score of '100' is hard-coded in, just replace it with 'finalScore' (if it is in the constructor itself). If there is a seperate method for creating the image of the new Scoreboard object, then finalScore will have to be passed to that method; either by a parameter to the method, or by saving the finalScore in an instance variable, so the method can access it.
Private vs Public
By Loopy, with 4 replies.
Last reply by plcs, almost 13 years ago:
Loopy wrote...
If a class has a method that is private but you want to do a similar action in another class, how would I do this without changing private to public?
Inheritance is the best way to achieve this behaviour by having a sub class extend that class and changing it from private to protected as ttamasu suggested. However, if they really cannot be compared/contrasted then you could copy the contents of it across. But it is most likely that those two classes will have some common connections/traits that either mean they will share the same abstract super class, or that one wi
Locations of Actors
By wahaj, with 12 replies.
Last reply by wahaj, almost 13 years ago:
hmm. the highest i got was 63. I think I know why its not higher. In my scenario, I can have 3 or 4 and even more greeps at a single tomato pile but they dont pick up a tomato. I dont know why? my greeps move up to the center of the pile and keep moving in a circle around it. some of them still end up picking tomatoes but when they get back to the pile not all of them pick another one again
Health in Game - java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
By freddekl, with 2 replies.
Last reply by freddekl, almost 13 years ago:
Thanks for the fast reply! It worked!
uploading a game
By YasserHassan, with 2 replies.
Last reply by YasserHassan, almost 13 years ago:
Thank you loopy
User page error
By danpost, with 1 reply.
Replied to by davmac, almost 13 years ago:
I will look into it soon, thanks.
How to remove a color of an image for another one?
By USBest, with 6 replies.
Last reply by USBest, almost 13 years ago:
well...ok! Thank you danpost! :)
In my Snake Game the body parts overlap rather than follow
By Jesse_Orange, with no replies.
The body parts grow and then when you move they sit on the Snake Head - I need some help :( I think its because the lastx and last y are not set correctly because the body segments end up on the head
965
966
967
968
969
970
971
X