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
Getter/Setter methods in Superclass
By getreides, with 9 replies.
Last reply by getreides, almost 12 years ago:
Hello both, thank you again for quick and detailed answers! I've chosen to use the super keyword as described by davmac, and it does work!
Help Needed! detecting if object exists and code cleanup
By TheGoldenBucket, with 2 replies.
Last reply by TheGoldenBucket, almost 12 years ago:
Thanks, Hippo! Managed to get that working, and I will start using the "&&"s to clean up my code. Best of thanks, -TheGoldenBucket
Cannot get objects to remove from world correctly, HELP!
By RagingAsian, with 6 replies.
Last reply by RagingAsian, almost 12 years ago:
Thank you a lot, it is working perfectly.
How to edit a GreenfootImage
By Ben&Sam, with 9 replies.
Last reply by danpost, almost 12 years ago:
It looks like you need to create a list of pairings. However, since you already know that both sides of the pairings are one-character strings, you can use a simple String object to store the pairings. Start with: <Code Omitted>as a field within the class (declared outside of any method). Then, as each pairing is entered, add the pair to the String object: <Code Omitted>To apply the pairings to Label, use something like this:
Controls
By 60sChallange, with 6 replies.
Last reply by danpost, almost 12 years ago:
The 'if' statement is, in essence, a blocking statement. If the condition is 'false', the code block will not execute. You would say 'if some set of conditions are true, execute the following code'. I would suggest using 'else' in this matter ( that is: 'if (dy == 0) {} else { run space command }' ), and, in fact, that is exactly what you could do. The code within the empty curly brackets ( '{}' ) could be 'run left/right command':
Problem
By 60sChallange, with 11 replies.
Last reply by 60sChallange, almost 12 years ago:
ty
Snap to
By KiwiMC1482, with 8 replies.
Last reply by danpost, almost 12 years ago:
Ben&Sam wrote...
it was a joke..
Please refrain from creating non-constructive posts. davmac might reply with something like this:
what if Ben&Sam was banned
How to move up and down with just one button.
By Jellyfish, with 12 replies.
Last reply by Jellyfish, almost 12 years ago:
nvm
Animations
By Jellyfish, with no replies.
Hi how do I create moving animations for my character(s)?
game levels
By javaisanart, with 13 replies.
Last reply by danpost, almost 12 years ago:
The code I gave was supposed to be in your world subclass -- not in your new Hud actor subclass. In fact, the code as given will work in your world subclass without any changes. If you create a basic Actor subclass for HUD objects, make it a very basic class, like this: <Code Omitted>and change my line 5 to: <Code Omitted>Yes. That first line of code in this post is the entire class code.
Shooting problem
By Hawx_, with 10 replies.
Last reply by danpost, almost 12 years ago:
AmericanaStorm wrote...
This might be weird but would be the coding for the bullet to shoot in the actual bullet class and not the shooter class. Thanks
It sure does sound weird. It is not the behavior of a bullet to shoot a bullet. That behavior belongs to that of the shooter. The usual behavior of the bullet is to fly through the air until a target is reached or until it goes 'beyond' the end of the world (rather, reaches the edge of the world). Sometimes, instead of the bullet having the behavior to 'reach a target', the target will consume the bullet and lose health or die. Th
Gravity Physics Engine Troubles
By h123n, with 1 reply.
Replied to by h123n, almost 12 years ago:
Sorry guys, I found I didn't use the if statement correctly, instead of if (Ground = true) it is if (Ground == true)
How to make a Block disappear when I click on it.
By Jellyfish, with 6 replies.
Last reply by danpost, almost 12 years ago:
Jellyfish wrote...
I had to do getWorld().removeObject(this); and it works!
good job.
Adding an object of itself please help!
By h123n, with 5 replies.
Last reply by danpost, almost 12 years ago:
h123n wrote...
I wasn't sure what the actuall method was called, I've changed it now to .addObject (Not sure if it even is a method)
To be sure, check the documentation. For code in an Actor subclass, refer to the Actor class documentation, where you will find the 'getWorld' method that returns a World object; then, check the World class documentation, where you will find the 'addObject' method. You will always be able to follow this pattern for any 'dot' operated statement (each part returns an object reference or a value; and for any object reference, you can refer to the documenta
adding/subtracting integers?
By h123n, with 4 replies.
Last reply by h123n, almost 12 years ago:
Thanks! sorry for being a total noob, I am trying to make a physics engine
602
603
604
605
606
607
608
X