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
Dealing cards when the deck is clicked
By MrSandwich, with 5 replies.
Last reply by danpost, over 10 years ago:
MrSandwich wrote...
I'm a complete noob at Greenfoot and I am starting to give my first foots in programming in general. With this said I'm trying to do a card game
There is quite a lot involved in making a card game. As a "newbie" in programming in general, I would consider it a jump. You should build a foundation in both programming and in using greenfoot before trying an endeavor as extensive a project as that.
Where is my compile button
By mellie19^4, with 2 replies.
Last reply by davmac, over 10 years ago:
Greenfoot 3+ does not have a compile button. Instead, compilation is automatic.
Counter
By dchalmers, with 1 reply.
Replied to by danpost, over 10 years ago:
dchalmers wrote...
Im trying to use the counter method explained in the tutorial, but it won't work. Why?
Cannot tell without seeing what code you are trying to use.
System.out.println stops my game.
By MNic, with 1 reply.
Replied to by danpost, over 10 years ago:
The first time the terminal is opened (being used), the focus is transferred to it. You only need to change the focus back on the scenario. Just click on the greenfoot application frame. You can avoid this on future prints by not closing the terminal. You can hide the terminal instead of closing it or just leave it open.. As far as not printing the x-coordinate, you should be getting an IllegalStateException error due to the fact that you are trying to use 'brick.getX' when the actor is not in the world (the previous line removed it from the world).
360 Car Driving
By Randy., with 1 reply.
Replied to by Randy., over 10 years ago:
Nevermind I got it
adding sound to a command line game
By divinity, with 5 replies.
Last reply by danpost, over 10 years ago:
The code Randy gave is more for background music or sounds that need to be controlled (usually sounds of some duration). Quick blurbs for when specific occurences happen can usually be played without setting up a reference to it: <Code Omitted>
I JUST REPLACED MY WHOLE GAME WITH A DIFFERENT ONE
By Randy., with 1 reply.
Replied to by danpost, over 10 years ago:
You will just have to retrieve what you can from posts and other sources and then recreate the rest (it is always easier to second time -- and usually better).
Crashed background ?
By fejfo, with 1 reply.
Replied to by danpost, over 10 years ago:
fejfo wrote...
I was trying to generate the background of my world in code (a background made of dirt with some stones) and I got some crashed pixels
That is usually what happens when you add transparency to your world background image. Fill the background image 'b' with Color.WHITE after creating it.
Jump then fall script, not working
By Randy., with 12 replies.
Last reply by danpost, over 10 years ago:
Randy. wrote...
I'm getting a java.lang.NullPointerException error for <Code Omitted>so I added a sub-actor called "obstacle" and the error is still coming up
'obstacle' is a variable name, not a class name. Adding a sub-class of actor with that name will not accomplish anything. Anyway, the line given could not possibly produce that error. You need to show the error message you are getting by copy/pasting the entire trace output here.
Actor not in world error
By scanlan, with 1 reply.
Replied to by danpost, over 10 years ago:
You have three places where you remove all objects from the world -- specifically at lines 51, 58 and 65. If either lines 51 or 58 executes, 'isTouching' in the following 'if' condition cannot execute properly as the Seal object is also removed from the world. Because all code blocks for those three 'if's are exactly the same (lines 48 thru 51, lines 55 thru 58 and lines 62 thru 65), you can combine the conditions into one 'if' condition: <Code Omitted>Alternatively, if you have an intermediate Fish class bet
can't get kinectserver to work
By davidapitt, with no replies.
Hi, I’m having trouble getting the kinectserver to install on Mac. I’ve tried on linux too and get the same error. The error message in the terminal is: checking for the Boost thread library… no ** **configure: error: cannot find the flags to link with Boost thread Does anyone have any idea why this is happening? Thanks,
return error
By Bassusour, with 1 reply.
Replied to by Super_Hippo, over 10 years ago:
Look, the 'else' refer to the second 'if'... As you intended the code, you might want the 'else' to execute if the condition in line 3 isn't passed. In this case, you need to use another '}' after line 10 and remove line 16.
How to save game
By ItsJosh18, with 2 replies.
Last reply by ItsJosh18, over 10 years ago:
Cool thank you.
Images not equal (possible bug)
By DogeOverlord, with 3 replies.
Last reply by danpost, over 10 years ago:
Maybe the best way is to have an instance reference field to hold the image, set the image of the actor to it, then you can check the image of the actor with the field value as being the same object (using '==').
how to change value of variable when hits the edge
By Shadow7, with 1 reply.
Replied to by danpost, over 10 years ago:
Shadow7 wrote...
what i am trying to do is once this object reaches an edge it will multiply the value of the variable by -1
Line 3 in the code given is multiplying by positive one, not multiplying by negative one. You need the variable 'mv' to be maintained longer than during the single execution of the method; so, you need to move line 1 outside the method. This changes it from being a local variable to being an instance field which is maintained for as long the actor object exists.
486
487
488
489
490
491
492
X