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
Please help me buid my MP3 Player.
By steezyjapaneezy, with 4 replies.
Last reply by danpost, almost 11 years ago:
Well, I can say that having the field 'isPlaying' in the Button class is not very wise. You want more control over what is playing so that only one is playing at a time and the best way to handle that is to keep a reference to the last button pressed in the world class with an indicator of the active state of the jukebox thee also. You may want to look over my
Value Display Tutorial
scenario and make use of a SimpleActor class instead of creating all the classes you have for the buttons.
getWorld().removeObject(Shot);
By A2O, with 2 replies.
Last reply by Super_Hippo, almost 11 years ago:
By the way, please use the 'code' tags when posting code. It makes it much easier to read.
My level 3 isn't working. Don't know is its a class code or just lag. need help.
By zmkruse, with 1 reply.
Replied to by Super_Hippo, almost 11 years ago:
Be more specific about what isn't working.
Sending value from actor to world
By winzorg, with 1 reply.
Replied to by Super_Hippo, almost 11 years ago:
If there would be more than one crab in the world, each object would have its own 'wormsEaten' variable. If it would be static, all would share one variable. Since it is not static (and it shouldn't be), you can't get a variable of the class. Or in this case, you can't use a method on the class to get a value of an object. Actually I am not sure why the 'checkLives' method should be in the world class. And what are you trying to do? Add a new crab when the other one was eaten? Couldn't you just set its location back to (100,100)?
<Identifier> Expected
By HACK0SUARUS_R3X, with 1 reply.
Replied to by Super_Hippo, almost 11 years ago:
This: <Code Omitted> Should be: <Code Omitted>
Attack-animation
By A2O, with 1 reply.
Replied to by danpost, almost 11 years ago:
First, you need to decide, one way or the other, what will determine the image to revert back. You could use the timer or you could use the release of the "Y" key. Then use only the one way. As far as the timer, you are attempting to run it deep inside the 'shoot' method, which means that it will only run when (a) counter1 == 0 and (b) Greenfoot.isKeyDown("Y") == true. For the 19 act cycles that the value of counter1 was not zero, the timer will not run. What I am getting at is that the timer must be executed outside any conditions that are required for shooting. If, instead of increment
Walls not working as intended
By sidetracked, with 4 replies.
Last reply by sidetracked, almost 11 years ago:
thanks, I'll try these suggestions and update when I get home
What does int xOff and int yOff do?
By aang.18, with 4 replies.
Last reply by Super_Hippo, almost 11 years ago:
Both locations would be at the same position.
New help with a project
By DomNow, with 3 replies.
Last reply by DomNow, almost 11 years ago:
Thanks guys I figured it out by putting in ranNumber generator and and putting new addObject in the code
Adding a button to the screen and changing its image?
By hoveeagle, with 9 replies.
Last reply by hoveeagle, almost 11 years ago:
Hope this ^^ helps
How Do I Count the Number of Spaces my Actor has Moved?
By CodeMode017, with 1 reply.
Replied to by danpost, almost 11 years ago:
CodeMode017 wrote...
Is there a way to count the spaces my actor has moved?
Starting when -- when it was place into the world or at that instant in time?
I know I need to save the number as some sort of variable that should look something like this: "for (int i = 0; i < 10; i++)"
Maybe the java tutorial page on
variables
might help.
need help
By rollsafe, with 1 reply.
Replied to by danpost, almost 11 years ago:
It probably says that it cannot find 'get' method. You should review the methods available for the class (look at the API documentation).
Expressions || and && !
By JavaLover, with 1 reply.
Replied to by davmac, almost 11 years ago:
No. (It is the same as "! (!X && !Y)"). Consider X=false and Y=true.
Unkown Errors and Exceptions with Integer.parseint()
By polypoly, with 5 replies.
Last reply by polypoly, almost 11 years ago:
@SteveBarnes works perfectly and makes sense. because before the user inputs the ask its trying to make it into an integer for tDist. i guess parseInt() doesn't have a way of handling null values? either way, thanks for the help
Turn Towards an Object/Actor as an Object/Actor
By Vicidsmart, with 1 reply.
Replied to by Super_Hippo, almost 11 years ago:
'getX' and 'getY' are methods of the Actor class. <Code Omitted>
519
520
521
522
523
524
525
X