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
Let the actor do something if he is on a specific position
By Sk1llG4m3r, with 1 reply.
Replied to by danpost, about 9 years ago:
Add an actor to act as a door or gateway. It can have an image or be transparent. It can have a reference field to hold the world it leads to and check for the actor to contact it and change to that world. Its class code could be like this:
ran into another problem need help
By nathen, with no replies.
im trying to get a destruction animation after i shoot a bug here is my code <Code Omitted>
Best way to get the projectile to Fire in a certain direction.
By dlamc, with 3 replies.
Last reply by danpost, about 9 years ago:
dlamc wrote...
I think I understand what your change does, but I'm still learning Greenfoot's syntax. Could you/someone explain to me what this code does just to make sure I understand?
Line 1 creates the Bullet object and stores it in an object reference variable 'bullet' which is declared to hold an object of type 'Bullet'. Line 2 adds the bullet into the world at the location of the tank. Line 3 sets the rotation of the bullet to that of the tank. I could have spent lines of code on it like this:
Scenarios
By Nosson1459, with no replies.
Is it possible to run scenarios in Google Chrome and Microsoft Edge or only in Internet Explorer?
How come, if Java is stored on the Local Disk (C:) (not on network (which it can't be anyway)) I have to go to the Java Control Panel Item and put in the Greenfoot website on each user separately (same Java why different security)?
array required but String found
By divinity, with 15 replies.
Last reply by danpost, about 9 years ago:
divinity wrote...
in my ide it is saying line 37
What does it say about line 37 (hover over it?)
Controls not working and can't find why, also implementing a floor?
By Baguette, with 2 replies.
Last reply by Baguette, about 9 years ago:
Works brilliantly! Thank you very much. I'm sure I'll be back with more questions. Thanks for a swift response too!
i need help slowing down the transition between two images to create an animation
By nathen, with 2 replies.
Last reply by nathen, about 9 years ago:
thank you!
Continuos Gaming
By lolitsme, with 1 reply.
Replied to by danpost, about 9 years ago:
lolitsme wrote...
So I am making a zombie game that once my actor enters a door it moves to the next level. The problems is I don't know what are the codes that once I run my program I can play it wherein I don't have to stop it just to move to the next level.
I will presume that your levels are in different World subclasses. If so, then use the Greenfoot class method 'setWorld': <Code Omitted>
From entering a door/passage that automatically moves you to the next level
By lolitsme, with 6 replies.
Last reply by danpost, about 9 years ago:
lolitsme wrote...
Ohh! Last question, how can I make it continuous? I can know move from level 1 to level 2. I dont know what to do with level 3
Just add additional if statements in the 'isTouching(Door.class)' block.
[Tutorial] Create FlappyBird
By AzharC, with 3 replies.
Last reply by AzharC, about 9 years ago:
website is complete now with tutorials on how to create Flappy Bird. There are a total of 26 mini-lessons. Enjoy!
how to make text in java?
By sahtiamurti, with 5 replies.
Last reply by danpost, about 9 years ago:
sahtiamurti wrote...
i make a button in greenfoot but i want to put a text in the button, how to do it?
How to create a button with text is explained in my
Value Display Tutorial
.
Trade Help
By bleeblob43, with 1 reply.
Replied to by danpost, about 9 years ago:
bleeblob43 wrote...
Should I have an inventory class with integers for each number of items
An inventory is just a list of items. Java already has an extensive supply of classes that create all kinds of lists. However, you might want some extra methods that are not readily available (like getting the number of objects of a specific type in the list; or, getting one or all objects of a specific type from the list). It would make sense then to create a subclass of the ArrayList class to add those methods that deal with Class types. Something like this:
getObjectsInRange question
By ZoeF, with 3 replies.
Last reply by danpost, about 9 years ago:
Okay. Have world create and maintain the list adding when created and added to world and removing any that are removed from the world. Then, have the tower determine the first in the list from what are in range:
add object on the same position
By Sk1llG4m3r, with 3 replies.
Last reply by danpost, about 9 years ago:
Sk1llG4m3r wrote...
it says: x(y) is not public in Greenfoot.actor;cannot be accessed by outside package
Show what code you tried when you got that error message.
How can I get the images on the left side of the screen to change with a mouse click?
By Astralman, with 1 reply.
Replied to by Super_Hippo, about 9 years ago:
Line 10 needs a condition: <Code Omitted>
426
427
428
429
430
431
432
X