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
java.lang.NullPointerException
By James-S, with 1 reply.
Replied to by Super_Hippo, over 10 years ago:
Do you add the Point object into your world? You created it with this line: <Code Omitted>'getWorld' returns null on this object if it isn't in the world (so either not added at all or removed). To add it, you can use this line: <Code Omitted>
Need an actor to always be on top visually.
By Reaper47, with 2 replies.
Last reply by Reaper47, over 10 years ago:
SPower wrote...
It is possible, using the setPaintOrder method in world. In the world's constructor, add something like this: <Code Omitted>You could specify the order in which they need to appear, the first one being the type that will be displayed on top of following ones, but if I'm not mistaken, specifying only one class will ensure it will get drawn on top of all the others.
I'll tweak around with this and look more into it if needed. Thank you.
Is there a boolean for Greenfoot.stop()?
By rebeccarsn, with 3 replies.
Last reply by danpost, over 10 years ago:
rebeccarsn wrote...
I'm working on a space shooter game, where the attackining space ships, who are coming down to the player's ship, are getting faster and faster. So the degree of difficulty increases but not to fast.
To slow down the speeding up of the space ships, you could do something like this: <Code Omitted>(have the value of 'i' start at the slow down value)
How to replace 4 objects with 4 other objects with key command.
By AlfPacino, with 3 replies.
Last reply by danpost, over 10 years ago:
AlfPacino wrote...
The thing is that i don't know the code that i should use. I can make it dissapear. But i don't know how to put the new actor in the same coordinates. And that for each answer (both correct and incorrect) and the question given after answering correctly.
Please show your world class code.
Replacement
By MrPancakes, with 3 replies.
Last reply by danpost, over 10 years ago:
MrPancakes wrote...
can you maybe put that in code or is that very difficult?
It is not difficult: <Code Omitted>
Given Key
By 3r1kMort, with 1 reply.
Replied to by danpost, over 10 years ago:
In general (in NPC class): <Code Omitted>where 'dialogComplete' is a boolean field in the NPC class and 'key' is a public Key reference field in the player class. Also, 'player', in the code given, is not the class name here. It is a reference to the object representing the player. The class does not get the key -- the player instance does.
Changing a door image from a closed door to an open one after the object has been removed.
By bilibull, with 6 replies.
Last reply by bilibull, over 10 years ago:
Oh... so thats how you do it without duplication! Thanks you so much!
Need help with setting up footstep audio for WASD movement.
By Reaper47, with 2 replies.
Last reply by Reaper47, over 10 years ago:
Okay, that makes sense. I think I can do that, thank you.
what will it print
By joseph.a, with 1 reply.
Replied to by danpost, over 10 years ago:
The last line is the "print" line. What is it printing? HINT: what type of variable is being printed? what value was assigned to the variable?
How to
By Ryan5, with no replies.
How to request to enter into a class or group
Can't get any scenarios
By ashamemnon@gmail.com, with 5 replies.
Last reply by ashamemnon@gmail.com, over 10 years ago:
Oh, yeah. Found the scenarios! (yay!)
How to change a class name using arrays...?
By Giantpotato, with 2 replies.
Last reply by valdes, over 10 years ago:
I don't really understand the logic of your code, but I can answer your main question. <Code Omitted> NOTE: <Code Omitted> doesn't create an array of size 3, is size 2. <Code Omitted> will generate an IndexOutOfBoundsException
Turning
By MrPancakes, with 1 reply.
Replied to by danpost, over 10 years ago:
Try replacing line 5 with: <Code Omitted>
x and y values
By smcgee, with 2 replies.
Last reply by smcgee, over 10 years ago:
Outstanding - thank you.
Stop walking ffs
By MrPancakes, with 7 replies.
Last reply by MrPancakes, over 10 years ago:
oh nevermind. i figured it out. Thanks for the code ;)
453
454
455
456
457
458
459
X