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
Teaching Greenfoot in an online environment
By s.witte@sendit.nodak.edu, with 1 reply.
Replied to by SPower, almost 13 years ago:
It's only available as a printed book.
Space Invaders
By SimpleJack, with no replies.
Hi, Im looking to create a space invaders game but im not sure what the best way to go about doing the damage to the houses (if you know the game you will see that it gets damaged where the bullet lands)
NullPointerException
By BradH, with 1 reply.
Replied to by danpost, almost 13 years ago:
The reason it does not work is that once you remove 'this' from the world, the 'getWorld' method will return 'null'. Looking at your code, it appears that everything after that statement (getWorld().removeObject(this);) is useless nonesense (creating new objects and removing them from a world they are not in). Either remove or comment out everything after the removal statement or put a 'return;' statement immediately after it.
ADDING A MESSAGE.
By jabirfatah91, with 12 replies.
Last reply by danpost, almost 13 years ago:
Why does it not help? In the Cannonball class act method, you should have code reflecting the following actions (at least): - move - if not targetHit and intersects target - show "HIT" message - option to remove cannonball or set flag targetHit (boolean field) - if at world edge - if not targetHit, show "MISSED" message - remove cannonball In your Cannon class, when you detect a "space" keypress and add a new cannonball into the world, show "" message.
Random Target
By Wavesludge, with 22 replies.
Last reply by danpost, almost 13 years ago:
Sorry about the Message thing. I though I had given you code for a Message class, but apparently it was someone else. Copy/paste the code for a Message class in
this discussion post
for your Message class.
Move Question
By BradH, with 1 reply.
Replied to by erdelf, almost 13 years ago:
use the move method of the smooth mover
Starting Up
By tgh2012, with 4 replies.
Last reply by tgh2012, almost 13 years ago:
Sent you an e-mail telling you my username on Skype.
Shooting
By macforce, with 2 replies.
Last reply by macforce, almost 13 years ago:
Solved
Intersecting object
By kevv, with 23 replies.
Last reply by danpost, almost 13 years ago:
kevv wrote...
Ok and add adding a new object of dead dragon would be a good idea?
This has new information (which would have helped, if I had known this previously). OK, we need to start over as far as 'adding/removing/deleting' dragons. You will need a field in the Dragon class, but it will need to be a 'static' field. It can hold either a Dragon object or be a boolean. Being a dragon object could make other coding easier. If holding a dragon object: It will hold the dragon object that IS alive. It should be changed to 'null' when the live dragon is killed. It should be check
Problem with codes!
By jabirfatah91, with 8 replies.
Last reply by danpost, almost 13 years ago:
Getting to your issues above (not in order): (4) Since you have now unbounded your world (put the extra parameter 'false' in your world 'super' constructor), this is not an issue. (3) You should allow passage over all possibilities of power. Incrementing is the way to go. (2) You will need to do two things to fix this. One set a minimum on the power to 30 and add a 'setPaintOrder' statement in your world constructor so that the cannonball is hidden behind the cannon while passing up the tube. (1) I addressed this earlier in the discussion.
Book Scenario - Piano
By mborders7786, with 7 replies.
Last reply by mjrb4, almost 13 years ago:
It seems the new wav files aren't in a format your system can play directly - this happens sometimes. You may want to try converting them to mp3s (use Audacity) and try again.
Automated Turret Issue
By GreenGoo, with 4 replies.
Last reply by danpost, almost 13 years ago:
The return needs to be cast to an Actor type. Use <Code Omitted>As an Object type, which is the type returned, it cannot be set to a field which holds an Actor type.
How do you make an item which is clicked change the background?
By tobi1066, with 4 replies.
Last reply by SPower, almost 13 years ago:
<Code Omitted>
Color to integer
By SPower, with 4 replies.
Last reply by SPower, almost 13 years ago:
@davmac Thanks so much, that's exactly what I needed!
Change to next level
By sirius, with 21 replies.
Last reply by sirius, almost 13 years ago:
Hmm ok now its clear. Thanks.
921
922
923
924
925
926
927
X