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
New to Greenfoot, please help!
By Dave, with 15 replies.
Last reply by Dave, almost 13 years ago:
The Menu now appears at the top left on my game screen =) I need to now try and add a help section inside the menu which includes instructions on how to play the game, figure out how to add another two levels which start after the level before is completed and some form of power up but don't worry I don't expect you to help me with that! lol Since I have started at my new college Greenfoot has not opened up ONCE on their computers even from the stand alone on my memory stick, this isn't just happening to me but it does work for most of the students there. That is why I am so grateful for a
How to get coordinates of List objects
By MattT, with 3 replies.
Last reply by Duta, almost 13 years ago:
MattT wrote...
Unfortunately, I do not know how to run methods inside List objects. Any suggestions? Thank you. :)
Do you mean methods held inside Boat.class? If so, here's a code snippet demonstrating it: <Code Omitted>Where x is the boat's position within the list
java.lang.IllegalStateException: Actor not in world. An attempt was made to use the actor's location while it is not in the world. Either it has not yet been inserted, or it has been removed.
By TopInPut, with 7 replies.
Last reply by danpost, almost 13 years ago:
Yes, only because there is no other code in the method. However, if more code was added later on, the if-else if statement would not prevent that code from executing, and would probably cause a run-time error (trying to do something to an object that is no longer in the world). Use of the 'return;' statement, especially after removing the object from the world, is more of a fail-safe.
error
By Tomc84, with 1 reply.
Replied to by Tomc84, almost 13 years ago:
never mind this post I found my problem
Trying to create a "level"
By Nemean, with 1 reply.
Replied to by kiarocks, almost 13 years ago:
You will need a sewperate world, and when you <Code Omitted> your world will be passed an Issac as one of the arguments. Then spawn that Issac in the new wold and it should work.
Limit to number of Actors?
By TheNightStrider, with 3 replies.
Last reply by davmac, almost 13 years ago:
That's right.
Automatic keypressing
By Green101, with 1 reply.
Replied to by danpost, almost 13 years ago:
Do you mean like, set up a boolean to track whose turn it is to draw (maybe called 'iaTurn'), and if it is false then get keystrokes from the keyboard and if it is true get characters from a list (or something like that)? If that is what you were looking for, you will need one more boolean to track 'iaIsDrawing' and a String to hold the last 'iaChar' and an integer to count down the time the "key is held down".
getting the length of a sound
By Busch2207, with 5 replies.
Last reply by Busch2207, almost 13 years ago:
Yes, of course I will do that. But at the moment I'm working on a loading screen for my new game.
string and counter
By Tomc84, with 8 replies.
Last reply by Tomc84, almost 13 years ago:
Like this? public void ballMove() // NEW MOVE METHOD { if (getY() == 0 || getY() == 500-1) { ((PongWorld)getWorld()).updateScore(this); //((PongWorld)getWorld()).p1.getScore(); Txt1.setText("john:" + ((PongWorld)getWorld()).p1.getScore()); //Txt1.setText("john:" + p1.getScore()); // updateTxtScore(); //Label.setText(getWorld().Txt1); //Label.setText(PongWorld.Txt1); //((PongWorld)getWorld()).updateScore(Label); //((PongWorld)getWorld()).update
Point-And-Click-Scenario
By MyHeartRocksNRolls, with 15 replies.
Last reply by davmac, almost 13 years ago:
I'm not sure if scrolling was what was wanted. MHRnR: have you tried reading the
Greenfoot API documentation
? There is a setBackground(...) method for the World class.
need help
By samipa, with 2 replies.
Last reply by samipa, almost 13 years ago:
Hello,Thank you very much i will have a look :)
Fleeing Worms
By jam0037, with 17 replies.
Last reply by jam0037, almost 13 years ago:
It's all right. It's really not worth that much trouble. Thank you for all your help. I really appreciate it. I'll post whatever ended up being wrong once I get my results back.
getObjectsInRange help!
By Y3llowMustang, with 16 replies.
Last reply by Y3llowMustang, almost 13 years ago:
Thanks for the help!(:
key control
By Alfie5, with 2 replies.
Last reply by davmac, almost 13 years ago:
This won't work what I am doing wrong?
For starters, your indentation is terrible... use "auto-layout" from the "edit" menu in the editor!
change the color of a label in world when actor location changes?
By lex404, with 22 replies.
Last reply by danpost, almost 13 years ago:
Often, in scenarios such as this, I would create a world instance integer variable called 'faze' (for phase), and use a switch in the act() method for processing at each phase. In your case, it would end up something like: faze = 0: if (!buttonClicked()) return; fetch(); faze = 1; return; faze = 1: if (!buttonClicked()) return; load(); faze = 2: pausebutton(); return; faze = 2: if (!squaresStopped()) return; setALU(); faze = 3; activatebutton(); return; faze = 3: if (!buttonClicked()) return; process(); faze = 4; return; faze = 4: if (!buttonClicked()) return; unload(); f
999
1000
1001
1002
1003
1004
1005
X