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
Greenfoot is acting weird on different devices
By Roshan123, with 2 replies.
Last reply by Roshan123, over 5 years ago:
Thanks a lot for it........◉‿◉
How do I make a transition between two worlds
By Just_in, with no replies.
Example: You are a Person and Walk in a wood. The next World is the End of the wood. You cant reach this in World 1 but in World 2. Trees got a hitbox. How to reach World 2 with your People?
Removing label class
By Roshan123, with 2 replies.
Last reply by Roshan123, over 5 years ago:
Ok, thanks for helping me out....
Help with spawning objects at random places (tictactoe)
By Al3xTheKing, with 1 reply.
Replied to by rocket770, over 5 years ago:
I think you're trying to find a spot on the board that has not been already used and since I don't know your code something similar to this might work? Pick a random Spot on the grid While the chosen spot on the grid is marked as a cross pick another spot Place Circle on the chosen spot
Problem with visualising multiple times during one act()
By 00swinter, with 1 reply.
Replied to by nccb, over 5 years ago:
You may want to try calling repaint() on the world after each step. By default Greenfoot only repaints after each act() round.
reference classes
By Patdumas77, with 2 replies.
Last reply by danpost, over 5 years ago:
rocket770 wrote...
If your Play Class is an object in the world you can reference it by this: Play play = getWorld().getObjects(Play.class).get(0); And now you should be able to access its attributes with for example play.PlayPause();
Typecasting is required for that assignment to be effective: <Code Omitted>
How to make an Actor(numbers of Actor) equal X?
By Kulo, with no replies.
So I made a zombie game where the zombies follow the Survivor(see below) but now I added the feature that zombies spawn and because of that the code has stopped working. So the question is how to make the Zombies equal X to make it work. Sorry for the bad desription. Thanks for your suggestions. <Code Omitted>
How do i have multiple levels?
By MrSkyPanda, with 1 reply.
Replied to by rocket770, over 5 years ago:
If you're checking a certain spot you can use it's X and Y Coordinates you can use this in your Character class: If(getX() == xlocation && getY() == ylocation){ Greenfoot.setWorld(new WorldNameHere()); } Where xlocation and ylocation are the coordinates of the spot you want to change the world. Alternatively, you can use an object that will change the world on collision. In your character class you add this line of code: If(isTouching(ObjectCLassName.class)){ Greenfoot.setWorld(new WorldNameHere()); }
Static int won't decrease.
By ItzLukeStorm, with 4 replies.
Last reply by Roshan123, over 5 years ago:
Welcome!!!!
getMicLevel does not work
By Mannu, with no replies.
In the Greenfoot book task 3.32 the method Greenfoot.getMicLevel should be used. While the sound-recorder and so my micrphone work, the method does not give any return value higher than zero. Can anybody help me to make the method work?
Making a png transparent
By Roshan123, with 9 replies.
Last reply by Roshan123, over 5 years ago:
I just wanted to know that is it possible to do something after drawing in the background of the world And i got the answer thanks to both of the genius!!!
How to achieve slow transitions ?
By Paul12345, with 3 replies.
Last reply by danpost, over 5 years ago:
Looks like you are trying to hog the CPU to slow down the execution. Well, if successful, you would only achieve what using delay would do -- slow everything down. Remove the method and post class that called it.
Greenfoot.Bee scenario
By Username123456789, with 16 replies.
Last reply by danpost, over 5 years ago:
Username123456789 wrote...
so it looks like this? << Code Omitted >> instead of "private void stats"
No. Utter confusion. Why would you have bee
lives
in the
Spider
class?
Greenfoot read file error window
By javaNewbie246, with no replies.
I have a program for my college final that I am having issues with, I have so far that on a key press, it should begin to read from a txt file for location information about birds and where to place them in the world, however when I press the key, I get a null error and a seperate error window pops up and simply repeats some method returns I have that state the birds health and infection count. if anybody knows what I have wrong please let me know. Below are the image of the error window and code I have that I believe to be in question.<Code Omitted>
Working wall
By iDragon3o6, with 3 replies.
Last reply by Gbasire, over 5 years ago:
You can do a simple thing to make some collisions in the player class, add this : <Code Omitted>it will basically check where you were the second before touching the wall and warp you back there
99
100
101
102
103
104
105
X