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
Timer, remove object
By Matt, with 1 reply.
Replied to by danpost, over 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, over 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, over 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, over 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, over 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, over 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, over 13 years ago:
Thanks for the fast reply! It worked!
uploading a game
By YasserHassan, with 2 replies.
Last reply by YasserHassan, over 13 years ago:
Thank you loopy
User page error
By danpost, with 1 reply.
Replied to by davmac, over 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, over 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
Importing an Image
By kartikitrak, with 5 replies.
Last reply by danpost, over 13 years ago:
Check your calling statement; make sure you are drawing on a GreenfootImage object. If inventorySlots is an object, not the image itself, you need to use: <Code Omitted>
Help..make a menu in first game and a link..
By Andriyanto, with 17 replies.
Last reply by Andriyanto, over 13 years ago:
tylers : thank you..nothing error again..
Teleporting problem?
By PiercingGoblin, with 13 replies.
Last reply by danpost, over 13 years ago:
danpost wrote...
I am not sure if this will correct the functionality of it, but it appears that line 48 should be '&&', not '||'. Same with line 67.
I had mentioned this two days ago. The same post continued
danpost wrote...
I think the coding had been made more complicated than need be because of seperate classes (redportal/blueportal) for the portals. You can make them both the same class and add the Color of the portal as a parameter in the constructor of the 'Portal' class -- public Portal(Color color). You can add an instance variable of Portal class to the code declared with -
Adding Actor Button
By BadatCoding, with 10 replies.
Last reply by danpost, over 13 years ago:
danpost wrote...
Yeah, the mouse checks did that, change the Preview class act() method to: <Code Omitted>I will double-check and make sure it works.
Wan
968
969
970
971
972
973
974
X