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
Can't find out how to delete moving object at edge of world
By Arakniode, with 1 reply.
Replied to by Super_Hippo, almost 11 years ago:
Arakniode wrote...
but it doesn't quite work...
This isn't very accurately. You created an infinite loop there. Line 14 calls the 'isInWorld' method, this one calls the 'crabMovement' method (line 47) which itself calls the 'isInWorld' method again. In line 15, you even want to start all this again. The crab never moves because 'isInWorld' always returns 'false'. Even if this would not happen and your crab would move, you will probably get a nullpointer exception when it moves to the edge of the world. This is because if it is at the edge, you remove it from the world (call to the me
Stairs&Slides
By CodeMode017, with no replies.
We just made a new game in our computer programming class. I'd like if everyone would try it. Please help us out and leave a good review, as this is a class project and we get points if you tell us a good thing about our game. :) Thanks!
Changing Image of Actor
By ironphoenix20, with 9 replies.
Last reply by davmac, almost 11 years ago:
Then either the code in those lines isn't actually executing (that is, the condition "cardCount==4 && level2over==4" may not be being met) or something is setting the world back again. I'm pretty sure the problem is not in the code you've posted (except for the problem I mentioned above).
Flappy Bird
By sosimple, with 1 reply.
Replied to by danpost, almost 11 years ago:
In the 'move' method, you are using the Greenfoot class 'mouseClicked' method, which returns 'true' once each time a mouse button is released. Now, within the code that executes when a mouse button is released, you are incrementing the 'timer' field, which is currently just counting the number of mouse clicks detected. You should find that after 100 clicks, even the instantaneous going up will stop occurring. Basically, you need to re-think your logic so that the incrementing of the 'timer' field will continue once it has started. Also, you show the bird going down at a rate of 5 pixels pe
unravel this bodmas
By divinity, with 2 replies.
Last reply by divinity, almost 11 years ago:
thank you super_hippo very much
An actor following another actor
By Ben3, with 1 reply.
Replied to by danpost, almost 11 years ago:
It is not a matter of whether you should create a whole new method or not; it is a matter of removing the random moving code and adding code to turn toward the main character and move. As you have not shown what code you do have, it would be difficult to say exactly what should be changed as far as they are concerned.
Please help me - Getter doesn't work
By TestUser2001, with 2 replies.
Last reply by TestUser2001, almost 11 years ago:
Thank you! It works perfectly.
Random Answer Selection Error
By chvia, with 2 replies.
Last reply by chvia, almost 11 years ago:
Super_Hippo wrote...
Where do you add the AnswerButton1 objects into the world? You won't be able to display three different wrong answers because you use one static int 'subnum'. Why do you use 'protected static int' at all? You could create one Button class which can hold a correct or incorrect answer. Then you add four of them into the world.
The code that's inside of AnswerButton1 will be copied into the other 3 answer buttons so I will effectively have 4 answer buttons like you suggesting. And I used the 'protected static int' in order to keep each frame from generating and
Removing Actor
By ironphoenix20, with 45 replies.
Last reply by danpost, almost 11 years ago:
ironphoenix20 wrote...
So, what am I supposed to do?
You can start by removing everything from line 5 to line 21 above (in my last code posting) from your code -- and similar code for the other cards.
Shooting a Laser
By Tesseract42, with 1 reply.
Replied to by danpost, almost 11 years ago:
By using a 'while' loop in the LaserCat class, code execution stays in the 'shootLaser' method and does not allow the 'act' method of the Laser class to execute. This prevents the value of 'noWallDetected' to not have a chance to change; thereby, locking the exeecutiion within the loop. In greenfoot, code your objects for what they need to do during each instance in time -- not for what they need to do in the long run.
Exercise 7.19/7.20 Questions
By JaneSmith, with 15 replies.
Last reply by JaneSmith, almost 11 years ago:
post
Class AnimatedActor
By TomazVDSN, with 5 replies.
Last reply by TomazVDSN, almost 11 years ago:
.
need some insight here
By divinity, with 7 replies.
Last reply by divinity, almost 11 years ago:
okay thank you both danpost and super_hippo
Error after changes
By bridget, with 5 replies.
Last reply by bridget, almost 11 years ago:
I did reinstall it, and now it works. Thank you for the tip.
Show distance
By javastudent, with 3 replies.
Last reply by danpost, almost 11 years ago:
Numbers do not have distances and planes do not have numbers. Numbers have differences and planes have points. Points use two values to represent their location within a plane called coordinates. Try to explain what you need using these definitions.
507
508
509
510
511
512
513
X