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
Remove an arraylist of the same actor in order
By cycv5, with 6 replies.
Last reply by cycv5, over 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, over 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, over 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, over 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, over 8 years ago:
Try the 'Greenfoot.ask' method.
Changing directions
By Spicy0506, with 3 replies.
Last reply by danpost, over 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, over 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, over 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, over 8 years ago:
thank you!!!!
run methode once
By ZiweZhang, with 3 replies.
Last reply by danpost, over 8 years ago:
Change line 10 to: <Code Omitted>
Disable JavaScript version of scenario
By Game/maniac, with 2 replies.
Last reply by Game/maniac, over 8 years ago:
Thank you.
spawning arrows
By doglover555, with 2 replies.
Last reply by danpost, over 8 years ago:
I agree that only one subclass for the arrows is the way to go. I also believe you should have actors for the pads (again, using only one subclass of Actor). The rotation of a pad can be given to any arrow that approaches it and the arrows can be placed into the world at the location of its pad and immediately moved to the other end of the alley so it can begin its approach.
Removing object
By ZiweZhang, with 1 reply.
Replied to by Super_Hippo, over 8 years ago:
This should work: <Code Omitted>
Show only one object of a class after hidden
By Rapoo, with 5 replies.
Last reply by danpost, over 8 years ago:
Instead of using 'clear' on the image, it might be better to set the image of the actor to 'null' <Code Omitted>It can then be easily checked as to whether it is showing or not: <Code Omitted>
Getting error message cannot find symbol - methodCanSee
By IlikeThePrequels, with 2 replies.
Last reply by IlikeThePrequels, over 8 years ago:
Thanks man
280
281
282
283
284
285
286
X