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
problem with neighbor count
By ttt, with 4 replies.
Last reply by ttt_, about 13 hours ago:
danpost wrote...
ttt wrote...
The Actor method getNeighbours() gives strange results in certain situations. << Code Omitted >>
I do not seem to be getting any strange results. Maybe you can give examples. Like, for what image do you get for what strange results (that is, give image AND results). The results can be given as in the following: For image "yellow-draught.png", I got 2 in the corners, 3 along the edges and 4 in the interior. I got these results regardless of the image size.
Sorry, there was a screenshot attached, but this didn't work. Huh? For the moment
Stopping a walking soundloop upon death
By Sendaris8, with 4 replies.
Last reply by danpost, about 20 hours ago:
Sendaris8 wrote...
What do you mean by 'call this new method from wolf/bear classes'?
I mean add the "new method" above,
die()
, to your
Guy
class. Then you can use something like the following in the
Bear
and
Wolf
classes: <Code Omitted>
Using an array switch to a new world
By thunesm, with 5 replies.
Last reply by danpost, 1 day ago:
Looks like I missed one case world: <Code Omitted> And actually, the final range is 1 to 36 as 49 is the character code for '1' (not 48) which shifts everything up by 1. (48 is the character code for a '0' (zero)).
Rhythm Game in Greenfoot?
By SuseGD, with 3 replies.
Last reply by PhilipsManor, 7 days ago:
SuseGD wrote...
danpost wrote...
As always, start with the basics -- your
World
subclass and
Actor
classes. Actors should interact or positioned to determine when a user action is to be executed. Depending on what you want, add a timing system or some type of a scoring system, or both (controlled by the world). If you have specific problems with the code, then show codes, indicate how it is not doing what you want and what you do want.
Hey, thanks for the response! Maybe I should've been a bit more specific with my question; I see that now. I have a general idea of how
Hame a litt error
By Punithan35, with 1 reply.
Replied to by Super_Hippo, 11 days ago:
Try to use fillOval instead of filloval.
Game stops when health reaches 0
By lemonade, with 1 reply.
Replied to by danpost, 17 days ago:
lemonade wrote...
when the player gets attacked by the enemies and the enemies reduce the players health to 0 or lower than 0 the game just stops and the terminal window pops up. Also the healthbar does not drop down to 0 after the final blow, but the game stops anyway, which is the bigger problem. << Code Omitted >> I would be super super thankful if anybody could help me because our teacher told us not to ask him for help
What did the terminal window display? (copy/paste output and error messages) You could remove the try/catch block from lines 387 to 396. If an error occurs ther
Exception in World constructor
By albert.wiedemann, with 1 reply.
Replied to by danpost, about 1 month ago:
albert.wiedemann wrote...
In one of my scenarios I get an error message ... I could upload the scenario in question if I knew where.
Please provide the "SubclassOfWorld" codes here (do a select all and paste). Use code tags also please (square brackets with the word "code" within, before and after the lines of code,and with a forward slash in the tag at the end).
Greenfoot / BlueJ on Windows Surface ARM architecture
By voitc, with no replies.
Hi there, one of our student is considering buying a Surface Pro tablet basing on a Snapdragon ARM architecture. Does Greenfoot (and/or BlueJ) will run proberly on this device? Thanks for answers.
Scenario not translating when published
By knaoii, with 3 replies.
Last reply by danpost, about 1 month ago:
knaoii wrote...
Thank you for the help. I made those changes and reuploaded but it still seems to be giving the INFO: Running TeaVM error. Still not really sure what it could be.
Sorry it didn't help. Maybe try making the
ArrayList
assignments in the constructor instead of in the declaration lines.
how to stop music after changing a few times of world ?
By rojina, with 3 replies.
Last reply by rojina, about 1 month ago:
thank you for your answer! i tried the second method you gave me and it works ! you are the best
error while after uploaded
By DIWAHAR, with 1 reply.
Replied to by danpost, about 1 month ago:
DIWAHAR wrote...
class: java.lang.Runtime exception - error occurs while export my game
You are referencing files in a manner that does not conform to the javascript translation. You are using file directory names, "sounds" and "images", followed by double back slashes, In Asteroid and Laser classes. Remove the directory names (and slashes) and just use the filename itself.
I want to add a white box with fixed width and height
By Coolboys, with 1 reply.
Replied to by danpost, about 2 months ago:
Coolboys wrote...
I want to add a white box with fixed width and height << Code Omitted >>
At line 20, create the box and fill it with white. Then, after creating the text image, draw it into the box: <Code Omitted>
Idea for Project
By Mrfl1mflam, with 2 replies.
Last reply by PhilipsManor, about 2 months ago:
I suppose I have a magnificent idea, young lad! You should use English, British (The most superior language :D ), Australian, Japanese, and Mandarin for thou project. If you don't want to be instructed by thou sweet mother to eat porridge colder than dear Goldilocks ever did, you shall follow my guidance. I have bestowed upon thee the most finest and most noble tongues to ever grace the realm of speech.
Roboterworld does not work.
By Kudo1507, with 1 reply.
Replied to by Kudo1507, about 2 months ago:
Hey, my idea for my roboter is that he loses energy if she moves but for some reason she says that she does not have any energy left after just one move but she keeps moving and the "Laderoboter" does not help her. He is supposed to go up to her and charge her but he does not do anything unless Robita is on his field. Here is her coding thing: public class Robita extends Roboter { /** * Globale Variablen (= Attribute) */ int energie; int maxEnergie ; //Start mit vollem Akku int batteryLevel = 10000; long geburtsZeitpunkt; char geschlecht;
HTML 5?
By InaKurateGames, with 1 reply.
Replied to by danpost, about 2 months ago:
InaKurateGames wrote...
My game isn't translating to HTML 5. How do I do that? (I'm using Java if that even matters)
Here are some restrictions you may not be aware of: * don't use "java.awt" of any kind * don't use "javax.swing" of any kind * reference all sound and image files in the "sounds" and "images" folders of your scenario folder without pathnames (just the file name)
1
2
3
4
X