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
How to check if 2 objects are touching each other?
By Zweeg, with 1 reply.
Replied to by danpost, almost 8 years ago:
For intersecting a specific object, use the
intersects(Actor)
method For intersecting any object of a specific class, use the
isTouching(Class)
method.
How to make a you win and you lose in a two player game(can someone help me!!!)
By DawnLight, with 3 replies.
Last reply by danpost, almost 8 years ago:
DawnLight wrote...
but how am i going to check if red or blue win??? i've been trying for a few days for now but i can't solve this problem.
danpost wrote...
determine winner by comparing scores
Having problems with a "missing return statement"
By DeRock, with 4 replies.
Last reply by DeRock, almost 8 years ago:
Thank you so much, worked perfectly!
Changing the code editor
By VladislavMoldovan, with 4 replies.
Last reply by Yehuda, almost 8 years ago:
I have Windows 10 Pro, and I found them here: C:\Program Files (x86)\Greenfoot\lib\bluejcore.jar C:\Program Files (x86)\Greenfoot\lib\extensions\greenfoot.jar
Typing Game: pop() the first word in a stack one at a time
By cycv5, with 1 reply.
Replied to by danpost, almost 8 years ago:
You cannot pop the elements from the stack unconditionally if you want the list to retain anything. The command to pop needs to be in an 'if' block or something similar.
Remove an arraylist of the same actor in order
By cycv5, with 6 replies.
Last reply by cycv5, almost 8 years ago:
danpost wrote...
Line 5 assigns a new List object to 'ene' every act. You need to move that line outside of the method for it to remain persistent as long as the World object exists.
Thank you very much, really helpful!!
I need help! How do you make it when a certain amount of points is not reached Game over
By TheMidget, with 1 reply.
Replied to by danpost, almost 8 years ago:
TheMidget wrote...
when the person doesn't get a certain score how do I make it game over.
Well, first you would need some indicator for when this condition should be checked. This could be a time limit or a limit on number of moves. It could be at a certain break point as like the end of a level or something else. Whatever this indicator is, when indicated, check the score and either allow the game to continue or not. To stop the game, usually all it takes is a "Game Over" text message (with possibly showing the score) and stopping the scenario (using "Greenfoot.stop();").
How do I add text over multiple lines?
By itssemu, with 4 replies.
Last reply by Yehuda, almost 8 years ago:
You cannot put "\" in a String without one of the characters on the bottom of
this page
following it.
Hi! I need help!
By agray11202, with 5 replies.
Last reply by Yehuda, almost 8 years ago:
One should not be impolite/ill-mannered/rude to someone, whether that someone is a beginner or not.
How do I get reader's String Input in while running the program?
By cycv5, with 1 reply.
Replied to by Super_Hippo, almost 8 years ago:
Try the 'Greenfoot.ask' method.
Changing directions
By Spicy0506, with 3 replies.
Last reply by danpost, almost 8 years ago:
Spicy0506 wrote...
when the bikes are going in a direction (lets say right) and I press the left key the bike removes its self. Is there a way to not allow you to go the opposite direction at the specific time.
Add another condition along with the key detection for each direction. For example: <Code Omitted>
How to make a Triangle?
By PlanetUlme03, with 2 replies.
Last reply by danpost, almost 8 years ago:
PlanetUlme03 wrote...
<Code Omitted>i found this, but i dont knew how to use it. Could you help me?
For a triangle 'nPoints' would be '3' and 'xPoints' and 'yPoints' would both be int arrays of length 3. Let us say you had an image of size 100x100. To draw a triangle that goes from bottom-left corner to bottom-right corner to top-left corner (back to bottom-left corner), then you have this:
10 Second Timer
By Atebits, with 1 reply.
Replied to by danpost, almost 8 years ago:
Atebits wrote...
Im looking to make a basic 10 second timer in my game. The code goes along the lines of whats given below, my issue is knowing how long a second is in this fashion, is it 60 for running at 60fps? Or is it something other? << Code Omitted >>
Actually, it varies depending on the speed of your system. However, in general, at normal running speed, it is around 60 fps. Therefore, initializing your 'time' field to '600' would be about right. Sidenote: it is a bit strange to see a 'while' where an 'if' is sufficient. You could also code act method as follows:
how do i change the name of the Jordan each time the loop runs and adds an object
By itssemu, with 11 replies.
Last reply by itssemu, almost 8 years ago:
thank you!!!!
run methode once
By ZiweZhang, with 3 replies.
Last reply by danpost, almost 8 years ago:
Change line 10 to: <Code Omitted>
278
279
280
281
282
283
284
X