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
wait and walking on platforms
By Moho, with 3 replies.
Last reply by danpost, over 12 years ago:
That code would need to be placed somewhere around that which you call 'animate' from: <Code Omitted>Something like that.
Help walking on platforms
By Moho, with 3 replies.
Last reply by NikZ, over 12 years ago:
Is there a limit to acceleration? What if you character is falling through the platform because it skipped over it?
'this' and NPE
By Phiesel, with 1 reply.
Replied to by danpost, over 12 years ago:
Your 'quest1' object was never added into the 'title' world. In line 5 (Quest class), 'getWorld' will return a 'null' value. Line 7 tries to execute 'setQuest' on a non-existent world.
Platform wall help!
By rrose5, with 12 replies.
Last reply by rrose5, over 12 years ago:
Oh wow I cannot believe I missed that, thought I had it in the act method for sure , thanks
Image display from being invisible after it's number has been generated.
By 7788, with 8 replies.
Last reply by danpost, over 12 years ago:
Please explain what you have -- that is, are these classes: Numbers: name of class? extending what? code? Crosses: name of class? extending what? code?
please help spwaning obstacle
By kinobi, with 3 replies.
Last reply by kinobi, over 12 years ago:
ok never mind i got it like this public class hinderniss extends Actor { double hinderniss_SPEED = -3.0; public void act() { move(); turnrandom(); spawnhinderniss(); despawnhinderniss(); } public void move() { setLocation ( (int) (getX() + hinderniss_SPEED), getY() ); } public void turnrandom() { if (Greenfoot.getRandomNumber(100) < 10) { turn(Greenfoot.getRandomNumber(90) - 45); } } public void spawnhinderniss() {
Please Help. Keep getting errors
By Lboogie0208, with 12 replies.
Last reply by danpost, over 12 years ago:
You are still going to have problems with your image files not being found. From your original posting of the HomeworkWorld class, the suffixes for the image and sound strings were to be concatenated when passing the fields to the new Emoticon objects (within the 'for' loop, in the 'new Emoticon(/* here */);').
Adding sound: playing different sounds based on image clicked
By blangley83, with 9 replies.
Last reply by danpost, over 12 years ago:
@Lboogie0208 -- please start a new discussion thread for your issue and use the 'code'tag below the input box to insert your code into your post. Having the ability to refer to line numbers would be a great help in being able to assist. NVM -- I see that you have started a new one.
Spawn a specific number
By kinobi, with 2 replies.
Last reply by kinobi, over 12 years ago:
thanks mate
Random Number Generator
By CaptainMorgan, with 3 replies.
Last reply by danpost, over 12 years ago:
How are you displaying the numbers? are they Actors or are you drawing them onto the background of the world? If they are Actors, you can give them an instance int field to hold the number they display. Then, if you remove the actor when its number is chosen (and replace it with a counter -- as if covering the number), then you would only need to randomly choose one of the number displaying actor from those that are still in the world, Because you are removing chosen ones, one cannot be picked more than once. Because you are choosing the number displaying actor itself, you can place the
Image Display when Key is Pressed
By CaptainMorgan, with 14 replies.
Last reply by danpost, over 12 years ago:
CaptainMorgan wrote...
Ok, I've tried this but is this code meant to allow the if (Greenfoot.isKeyDown("space")) to place a counter on the coordinates when it's pressed?
As the code is shown by NikZ, counters will be placed at location (28, 28) when the space key is pressed.
Letter generation
By IeuanMcCrushems, with 3 replies.
Last reply by danpost, over 12 years ago:
If it is separate, you should create an actor class to display the text. Create an instance of that class with the text required when the space keystroke is detected.
adding alien when enemytype is dead
By davemib123, with 3 replies.
Last reply by davemib123, over 12 years ago:
thanks lordhershey. instanceof was exactly what was required.
Broken Scenario
By basil60, with 4 replies.
Last reply by danpost, over 12 years ago:
As far as the 'multiply' method -- I do not see one anywhere.
Lists and object references
By Zamoht, with 3 replies.
Last reply by danpost, over 12 years ago:
It seems like you could just use the following: <Code Omitted>Would this not do the same thing?
668
669
670
671
672
673
674
X