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
Repeat Until?
By saskekun95, with 1 reply.
Replied to by danpost, over 11 years ago:
You do not need seperate methods for 'downwards' and 'upwards'. All you need is to 'turn' the actor when the proper conditions are met. The conditions to turn around at the top of the screen are (1) the y-coordinate of the actor is zero and (2) the rotation of the actor is 270. The conditions to turn around at the bottom of the screen are (1) the y-coordinate of the actor is one less than the width of the world and (2) the rotation of the actor is 90. When either set of conditions is true, turn the actor around 180 degrees.
java.lang.nullpointerException-Error
By Mepp, with 6 replies.
Last reply by davmac, over 11 years ago:
That means that 'spf' is null. It is the same problem - you are calling a method on a null reference.
HELP! Is it possible to blend classes?
By sopi, with 5 replies.
Last reply by danpost, over 11 years ago:
What I see is a class with a Counter object called 'counter' that is never anything but 'null'; and, if the public method 'activate' is ever called, will cause a NullPointerException.
atWorldEdge Method
By ar_jay0525, with 2 replies.
Last reply by Phytrix, over 11 years ago:
It'd seem that the method doesn't exist. You can use the following code for an atWorldEdge method. Replace the 10s as you wish. Generally, people want objects to bounce when the edge of it hits the very borders of the world, so I'd recommend replacing the 10s with half of the size in pixels of your image. public boolean atWorldEdge() { if(getX() < 10 || getX() > getWorld().getWidth() - 10) return true; if(getY() < 10 || getY() > getWorld().getHeight() - 10) return true; else return false; }
Can't call method from world class in actor class
By ycart, with 2 replies.
Last reply by danpost, over 11 years ago:
I am quite sure that the 'startMission' method IS working. It is only called
once
after the mouse click. Each method it calls will run
one time
. Therefore, you will have a 1 in 300 chance of one Food object appearing; a 1 in 600 chance of one Treasures object appearing; and, a 1 in 100 chance of one Person object appearing. You would be very lucky to have anything appear, which is why it seems like it is not working. I think what you wanted is that these object randomly, but continuously, appear throughout the game. In order to accomplish this, you will need a boolean fie
stops game
By aananon, with 6 replies.
Last reply by danpost, over 11 years ago:
What you need to do is either control the rotation of the object so that the call to the 'move' method will move the object in the proper direction or keep track of the speed of the object in both the x and y directions. With either method, the proper adjustments to the rotation or value of the variables are needed when the object hits the walls.
Help with exporting problem
By BradH, with 5 replies.
Last reply by BradH, over 11 years ago:
oh no sorry, i was just wondering if anyone on this website could help, nothing to do with greenfoot.
One glitch in my greeps scenario
By JHankins, with no replies.
i do not want to post my code on here is there anyone that could let me know of a way to send it for review to get some advice?
cannot find symbol - constructor...
By Mepp, with 10 replies.
Last reply by Mepp, over 11 years ago:
Thanks, It worked fine now!
SOUND AT BACKGROUND PLEASE HELP!!!!
By Prish950, with 4 replies.
Last reply by Prish950, over 11 years ago:
Thank YOU :D
Errors
By DoctorProfessorYoshi, with 3 replies.
Last reply by danpost, over 11 years ago:
Sorry, I do not know a thing about that one.
Help with code!
By JHankins, with 1 reply.
Replied to by danpost, over 11 years ago:
It appears that what your instructor gave you was pseudo-code (code written in english form -- but not actual code). You have to 'convert' it to real code that the compiler can understand. Unless you summarized your code for the discussion. If this is the case, please post the code for the class. It may be that your bracketing is off.
PROBLEM BOMB EXPLODE!
By Prish950, with 12 replies.
Last reply by Prish950, over 11 years ago:
IT WORKS THANK YOU SO MUCH
Need help with my projekt.
By SKy., with 1 reply.
Replied to by danpost, over 11 years ago:
The jumping code, as shown above, says to teleport to the highest possible point up to 300 pixels from its current location without obstruction. What you want is to add an acceleration to its vertical speed so that its movement goes upward. The objects vertical speed will have to be kept track of. Each act cycle, add 1 to the vertical speed for the effect of gravity. If there is an object below this object (standing on something), set its vertical speed to the vertical speed of that on which it stands (of course, if the object does not rise or fall, then set the actors vertical speed t
BOMBERMAN HELP PLEASE FOR!!! int =??
By Prish950, with 8 replies.
Last reply by Prish950, over 11 years ago:
THX SO MUCH DANPOST NOW IT WORKS
872
873
874
875
876
877
878
X