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
Moving randomly in four directions?
By JamesHughes244, with 2 replies.
Last reply by JamesHughes244, over 9 years ago:
Thank you very much, this solution is great! The actor doesnt seem to stay near the same location in reality though so it works fine. Thanks again!
Enemy Health Not Working
By AreebRaza, with 20 replies.
Last reply by danpost, over 9 years ago:
AreebRaza wrote...
is it possible to make enemies with health in one class
What are the differences between the classes?
danpost wrote...
Remove 'static' from the 'health' declarations lines in the Skeleton classes at line 20.
Actually, I do not think anything in those classes should be declared as 'static' (as yet), except for maybe the images. Remove all occurrences of the word 'static' in those classes. Note (do not make any changes for this unless you fully understand or get further help on this): I mentioned the images because currently, as your code is, each en
getRotation() not setting rotation properly
By Xevinaly, with 3 replies.
Last reply by danpost, over 9 years ago:
The problem is due to the limitations of the screen and the speed of your CommandMissile actors, which is one. The pixels in the screen are arranged in rows and columns. When moving one pixel, there are a limited number of ways the movement can be made -- horizontally, vertically or diagonally (to one of eight pixels). This drastically reduces the number of angles that the missile can travel at. There are a couple of ways (at least) that you can compensate for this; one is to track the location coordinates of the missile with more precision and the other is to save the starting location of
Issue with object going backwards
By CuddlySpartan, with 5 replies.
Last reply by danpost, over 9 years ago:
CuddlySpartan wrote...
Okay so I tried that but it didn't quite work. When the bullet hit the camooctopus, the octopus would spawn not on the line so it wouldn't be able to move. It spawned below where the original camooctopus was.
Sorry -- I wrote that out a bit quickly. Line 4 above should be: <Code Omitted>
NullPointerException That I Really Need Help With
By mreed7231, with 4 replies.
Last reply by mreed7231, over 9 years ago:
danpost wrote...
(3) the block of code starting at line 22 of the mBullet class is missing its identifying code; should probably start with 'public void act()'.
THANKS FOR THE HELP that was the main issue causing my error and I'll go in and fix up that other stuff too.
Avoider game-help me fix problems
By donatela201, with 3 replies.
Last reply by danpost, over 9 years ago:
Please show the code for the class this 'addedToWorld' method is location within. Also, show what code you are using to add the Skull actor into the world.
This throws up an error help please
By SiWeller, with 3 replies.
Last reply by SiWeller, over 9 years ago:
its ok now thanks anyways
constructor cannot be applied to given types
By chrl98, with 7 replies.
Last reply by danpost, over 9 years ago:
Link99 wrote...
I need help with something similar, in my pokemon game I want to have an enemy appear every few steps I take, but the constructor for enemy required an int and a class from playerheroes.
You should start a new discussion thread on your issue -- not revive one that is over two years old. Also, you need to supply the codes you are currently using (the class of the enemy and the class of the playerheroes).
Background Music
By Camyh15, with 9 replies.
Last reply by Camyh15, over 9 years ago:
Thank you soooooo much!!!!!
How can i count objects in a radius ?
By Rabe123, with 2 replies.
Last reply by Rabe123, over 9 years ago:
ok thanks danpost :)
Turning Towards Object Help
By CuddlySpartan, with 4 replies.
Last reply by CuddlySpartan, over 9 years ago:
It's okay I was just joking with you :D I love you SPower <3
Stickman - Exercise 3.37
By david_h, with 1 reply.
Replied to by danpost, over 9 years ago:
If you do not have very many sound files and they are all fairly short, then I would suggest keeping a reference to all of them in a class array, like (let us say the code is in a 'MyWorld' class): <Code Omitted>Then: <Code Omitted>and: <Code Omitted>
How to stop background music when moving to a different World.
By KrystalLo, with 3 replies.
Last reply by danpost, over 9 years ago:
KrystalLo wrote...
And how would I do that? backgroundMusic.stop(); ??? Since when the pirate loses all his lives it immediately goes to the gameover world. And when the myWorld starts the background music starts and begins to loop whenever the song finishes.
<Code Omitted>
Shooting with different bullets
By MNastasi, with 1 reply.
Replied to by danpost, over 9 years ago:
It may be that you are using the 'getKey' method instead of using the 'isKeyDown' method with boolean fields to track the state of the keys.
switching worlds
By benbec1, with 1 reply.
Replied to by danpost, over 9 years ago:
You will not visually be able to tell whether the world changed or not because you are re-creating a copy of the same world. You could right click on the world after compiling and select 'Inspect' from the options; then run the scenario, press the "e" key and then pause the scenario; finally, right click on the world and select 'Inspect' again. At that point, if you have two "Inspect" windows open then they were different worlds. You should probably combine line 32 with line 34 so that you are not unnecessarily creating a new 'world' world every act cycle:
455
456
457
458
459
460
461
X