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
Why wont my actor fall through the bottom and appear at the top
By 23204, with 5 replies.
Last reply by danpost, almost 11 years ago:
23204 wrote...
Am i correct to say that: this.getY() <=0 means if the actor hits the top of the world?
You are correct in what the given line of code means.
I cant get my actor to turn 2 degrees when it hits the top of the world so they all just get stuck up there when i put multiples of them in the world.
I believe your actors are changing their rotations (or turning), but their direction of movement is limited by the speed at which they are moving. If you let it run long enough, you will probably start seeing them take off from the top edge. When moving
Looping with delay
By Freekywill, with 2 replies.
Last reply by Freekywill, almost 11 years ago:
I don't think this works, because I have an if statement checking when you click on it, but wouldn't you constantly have to click on it to make it run? Right now the code runs once and stops because it is so longer being clicked on. Edit - I just made a boolean that determines whether or not it should be running when you click. Thanks for the timer advice
CHASING AN ACTOR
By maxenee, with 1 reply.
Replied to by danpost, almost 11 years ago:
*Boulder object destroys actor (and game over) *Boulder object follows actor Show attempted code in your Boulder class.
Making a textbox
By Velociraptor06, with 13 replies.
Last reply by danpost, almost 11 years ago:
@JFish, I think you mean something like: <Code Omitted>
3 kills = 1 point not working.
By RussellBlo, with 1 reply.
Replied to by davmac, almost 11 years ago:
Because line 3 is resetting 'bomb' to 0 each time. If you want to keep a count that persists between calls to 'act', you need to use an instance variable.
Dr Who Game
By ConfusedProgrammer, with 2 replies.
Last reply by ConfusedProgrammer, almost 11 years ago:
dude thanks man, now hopefully ill see if that works :)
I can pay someone like $10 to do a project...
By H2Olivia, with 1 reply.
Replied to by triezen, almost 11 years ago:
wow, really? The whole purpose of having homework assignments is to do it yourself. No one is going to do your work for you. What you are asking for others to do is unethical. Why don't you just try and learn the material and do it. Asking for help is fine, but paying someone to do your work for you is not.
NullPointerException Help!
By Chandler.S, with 1 reply.
Replied to by danpost, almost 11 years ago:
It would be easier to have the Pirate2 object check for an intersecting bullet, remove the bullet and adjust its own lives.
scale method
By Vellyxenya, with 2 replies.
Last reply by Vellyxenya, almost 11 years ago:
Ah didn't think about it, thank you very much, it works! :)
help with this array program
By divinity, with 1 reply.
Replied to by danpost, almost 11 years ago:
It sure looks like it would be an arrayOutOfBounds exception. Lines 23 through 26 cause the values in your array to be printed to the terminal, leaving the value of 'i' at '6'. You probably just need to remove and insert lines 26 and 27 at line 36. Having line 21 in your code helped to produce your issue. It is best to declare 'for' loop counter variables in the 'for' statement itself unless you need the value beyond the loop. You can remove line 21 and change your 'for' statements to these: <Code Omitted>
How-To: draw directly on background/image?
By keizerbob, with 2 replies.
Last reply by keizerbob, almost 11 years ago:
danpost: Thanks for exactly the basic info I was after!
I need code to run every 3 seconds
By Hydrowarrior, with 1 reply.
Replied to by danpost, almost 11 years ago:
There are (1) omissions, (2) flaws and (3) peculiarities in the code you have supplied. First, what is distance, how is it controlled and should it be a factor in playing the sound -- or is the sound to play every 3 sconds, regardless? Second, you cannot control any aspect of a sound that you have no reference to (using 'Greenfoot.playSound' you cannot get a reference to the sound to control its volume). You need to create a GreenfootSound object and then set its volume and then play it. Finally, it appears you want the volume to increase as it approaches something (whatever distance is re
game causes problem with the program Greenfoot
By Rainbow11, with no replies.
Speed3D by Builderboy2005, 2009/1/31 New and improved Downloaded game and it causes Greenfoot to open off screen and I had to redownload program
Line of sight help
By darkmist255, with 12 replies.
Last reply by danpost, almost 11 years ago:
Normally, once the code for creating a line of sight and being able to determine whether any object obstructs it is completed, the image of the line of sight object would be made transparent. So there is nothing within the code given to act upon the line being upside down or not. This you will have to do yourself. Also, it would be better for both actors be passed to the line of sight object and have the line of sight object do the calculations. By doing so, it would be easy to have your actor determine which actor, it or the one creating a line of sight to, to pass as which argument to th
Problem with socket's InputStream
By stefan42, with 4 replies.
Last reply by stefan42, almost 11 years ago:
OK, now it works perfectly. Thank you!
500
501
502
503
504
505
506
X