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
Error Hitting Enemy
By Jillis, with 3 replies.
Last reply by danpost, over 9 years ago:
Jillis wrote...
I also receive this when the user dies. Do I need to put the same thing before each function is called in the user class too? < Code Omitted >
I do not think so -- I do not see where the user is removing itself from the world.
Returning a List of Actor objects
By rockon411, with 14 replies.
Last reply by rockon411, over 9 years ago:
Nevermind! It seems to work now. Thank you so much for your help!
Need help with Actor Class disappearing to top of image.
By Quzord, with 6 replies.
Last reply by danpost, over 9 years ago:
Quzord wrote...
It's at 1. but the character(player.class) is not there.
It is there. Select the field under where you see int length is 10 and inspect that. You should get the player and see its x and y coordinates in the world.
Just says null.
Where did you see this, exactly?
the int length is 10
No matter. That is just the initial number of elements the list is created to hold (before any objects are added to the list).
Problems with bullets
By macho_horse, with 2 replies.
Last reply by danpost, over 9 years ago:
The code is executed for each enemy object. As it executes for each one, the keyword 'this' will refer to the particular enemy object that the code is currently executing for. Therefore: <Code Omitted>or more simply (since 'this' is implicitly implied when no object is explicitly given to call a method on): <Code Omitted>
Timer to switch worlds
By TheAngryWarlord, with 4 replies.
Last reply by danpost, over 9 years ago:
The code given by 101929ha will not work. The timer can only work by way of an act method (lines 5 through 8 will only execute once -- when the timer is marked, or started): <Code Omitted>This would be for a 30-second timer in a scenario running at normal speeds -- along Hippo's suggestion.
HELP
By ALPH3A, with 1 reply.
Replied to by danpost, over 9 years ago:
If you used 'Greenfoot.getRandomNumber(4)', you will get a number in the set { 0, 1, 2, 3 }. Adding one to the result will get you a number between 1 and 4. If you are turning by 't*90' degrees and a turn must be executed then you must remember that '4*90 = 360' and no turn will be exacted (the actor will look in the same direction as before)..
Need help stopping music
By BobBanana, with 1 reply.
Replied to by danpost, over 9 years ago:
Is the first line inside or outside the method? Where is the code given located and what code starts the game and where is it located?
I can't get the terminal window onto my screen!
By Dylex, with 2 replies.
Last reply by Dylex, over 9 years ago:
That works mate, thanks.
java.lang.OutOfMemoryError: Java heap space
By heyu, with 6 replies.
Last reply by danpost, over 9 years ago:
Super_Hippo wrote...
The only thing I heard about was Greeps, but I thought that the Greeps (if that are the things moving around and trying to collect something I don't remember) had an act method and the user had to write the act method (which had some limitation of booleans), so the Greeps collect as much as possible on each map before the time runs out.
You are right -- the Greeps scenario does have an act method that is executed repeatedly (needed because each map is run in a specific amount of time or act cycles). I should not have included that in my list. Maybe I should not ha
Create transparent circle
By ironphoenix20, with 8 replies.
Last reply by ironphoenix20, over 9 years ago:
Thanks. It works now.
NullPointerException
By Nosson1459, with 2 replies.
Last reply by Nosson1459, over 9 years ago:
Super_Hippo wrote...
I think there is a chance that 'flash' is null and drawing with a 'null' color can't be done. I didn't test this yet and I don't know if it maybe was different in older Greenfoot versions, but it is an idea.
You were right, I didn't notice that 'flash' wasn't set yet. I edited line 28 to: <Code Omitted>
Publish failed
By Nosson1459, with 4 replies.
Last reply by Nosson1459, over 9 years ago:
davmac wrote...
It should be Ok now. We just transitioned (most) of the server from http to https and there have been a few teething problems - this was one of them.
Thanks, it worked.
removeTouching doesn't work
By vijer, with 9 replies.
Last reply by Nosson1459, over 9 years ago:
vijer wrote...
But you can't use it to remove theBall when it goes off the edge of the world?
If you want to remove the Ball when it goes off the edge of the screen, then you can put in the Ball class:
Super_Hippo wrote...
<Code Omitted>
Passing a variable from one class of a world to another class in another World.
By py-cod, with 3 replies.
Last reply by Super_Hippo, over 9 years ago:
You didn't add the constructor to the MyWorld class.
How to avoid nullPointerException
By wueschn, with 4 replies.
Last reply by wueschn, over 9 years ago:
@Nosson1459 Thanks a lot!!
376
377
378
379
380
381
382
X