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
Changing levels
By rachel1495, with 3 replies.
Last reply by davmac, over 13 years ago:
Ah. I guess that the "if" block is in some code that gets called by an act() method, which gets called every cycle. levelCount.getValue() still returns 1, so the condition is true and level 2 will be set continuously. One way to avoid this is to only set the level when the levelCount is increased. For instance, move the "if" block (from the player class) into the world's countLevels() method.
Prompt for world size with JOptionPanel
By mozrila, with 2 replies.
Last reply by mozrila, over 13 years ago:
Updated Updated code... <Code Omitted>
How do I make the music in my game play only when I'm pressing a button?
By Chocomint1213, with 2 replies.
Last reply by danpost, over 13 years ago:
If you want the music to start when you press the key and stop when you release it: <Code Omitted>
.dll in Greenfoot
By tollpatch, with no replies.
At first Hello, Within the documentation I found a workaround how to use .dlls or .jar files with Greenfoot. I'm not shure I understood everything well. Has anyone a scenario that use such a file? forwarding thanks from tollpatch
How to have buttons open/close a gate?
By hl2tf2, with 1 reply.
Replied to by hl2tf2, over 13 years ago:
have*
Multi Level Games
By tollpatch, with no replies.
My idea for a multi level game: It's a modification of Wombat, who has to push a loaf into a house to complete a level. In this moment I write only an abstract, if its not clear enough, ask more. Each level is a World, for example WombatWorld, IceWorld, WaterWorld, NightWorld...... The Actor classes are Wombat, House, Rock, Barrel and Loaf. Wombat is moved by arrow keys, Rocks and the House are fixed, the Loaf and the Barrels can be pushed by Wombat. These the only classes and are used in all levels. Within the Wombat class there is: <Code Omitted>Within the constructor of the XxxxWorld is: <Code Omitted> // otherwise ALL worlds will be run thru further on in the code, when the loaf reaches the house: <Code Omitted> Within the act methode of the World : <Code Omitted>The only thing I change from level to level is the image of the characters in the different worlds and within the creator how many rocks and barrels are there to create the difficulty of the level. Zamoht comments:
It works well up to 10 levels but not for 100.
I don't agree. One change may be helpfull: First generate a MasterWorld. It contains the act methode with arrow-key-reaction and level-end-detection. The LEVELWorlds than become subworlds. This supworlds ONLY have the positioning of the objects to form the level difficulty and the images. Anywhere this code has to be and whats bad to have it in a separate class? Besides I expact that this organisation makes it easy to write an level-generator for interested players. Whats the better way to a 100-level-game?
Some annoying bugs
By Solringolt, with 3 replies.
Last reply by Solringolt, over 13 years ago:
Heuuuu.... and how can I avoid them?
URGENT HELP
By aheadinstead, with 5 replies.
Last reply by danpost, over 13 years ago:
You only need change what happens when the keys are down: <Code Omitted>
textfield
By bahrie, with 1 reply.
Replied to by Gevater_Tod4711, over 13 years ago:
You could use
this textfield demo
. Or you also can use
this GUI classes
.
showing text
By bahrie, with 3 replies.
Last reply by Gevater_Tod4711, over 13 years ago:
Forgot to say: You need to import java.awt.Color to use the class Color.
Jumping
By Gingervitis, with 15 replies.
Last reply by Gingervitis, over 13 years ago:
I know what my mistake is. The ground is below the pengu so it would work if it was above it?
Removing the pause function at game over screen
By SP00F3R, with 3 replies.
Last reply by davmac, over 13 years ago:
Create a boolean variable in the world to track whether it is currently game over or not. Have the player class set that variable when it displays the game over screen. Check that variable before allowing the pause action.
How to make gravity
By carhad, with 5 replies.
Last reply by Gevater_Tod4711, over 13 years ago:
Maybe this engine can help you:
Grafity Engine
Multiple levels
By DoctorProfessorYoshi, with 5 replies.
Last reply by Duta, over 13 years ago:
I completely forgot to upload the scenario I made for you a couple of days ago >.< It's
here
.
The difference betwen greenfoot.stop() and the pause button?
By rowanto, with 12 replies.
Last reply by danpost, over 13 years ago:
What this essentially does, is split the act method into two separate parts. You can put a condition on doing the second part, something like this: <Code Omitted>With this the second part will be executed every time until the game is paused. Then, when restarted, the world class 'started' method will call the 'restarted' method here to do the second part that was not done ye
822
823
824
825
826
827
828
X