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
objectsatoffset -> return??
By LegendofLife, with 6 replies.
Last reply by danpost, over 8 years ago:
LegendofLife wrote...
how to use that "null"
Just as given
<Code Omitted>If no wand is detected at the location, a 'null' value is returned.
How to limit spawning?
By Penlos, with 11 replies.
Last reply by danpost, over 8 years ago:
Penlos wrote...
now, if I do nothing and kill no birds I get a problem: java.lang.NullPointerException at Bird.act(Bird.java:41)
Need to see the Bird class codes. Indicate which line is line 41.
Random spawning
By alexaa, with 6 replies.
Last reply by danpost, over 8 years ago:
alexaa wrote...
How would i get the orbs to not spawn a ton at a time? I was trying to only get one or two to spawn every couple of seconds. I got it to work but it spawns a ton at a time.
In this line of the 'randomSpawn' method: <Code Omitted>either decrease the '60' or increase the '100' (or both).
How to click menu to have sound
By Archimedes007, with 8 replies.
Last reply by Super_Hippo, over 8 years ago:
<Code Omitted> Then, when changing the world from an actor in the world: <Code Omitted>
Start world in middle
By Trystar360, with 1 reply.
Replied to by Super_Hippo, over 8 years ago:
In line 44, instead of x and y, you could use x-14 and y-14.
use variable from specific instance of an actor
By Trystar360, with 2 replies.
Last reply by Trystar360, over 8 years ago:
I have an actor and i have 4 booleans telling if there are walls on the left, right, up or down. then i need to use that in a different actor to know if it can move or not. the actor i need the booleans from.
isTouching Error
By Archimedes007, with 7 replies.
Last reply by danpost, over 8 years ago:
Archimedes007 wrote...
where can i put that code buddy ?
Like I said before:
Best place to put the line is immediately after the 'addScore' line.
Change 'getScore()' in the line being inserted to 'score'.
Loop enemy spawning
By KimoDev, with 2 replies.
Last reply by danpost, over 8 years ago:
The loop is what is causing multiples to be spawned at once. Use an if statement with a random chance to spawn.
Solid Wall
By Kevroa, with 3 replies.
Last reply by danpost, over 8 years ago:
Okay, first thing that needs done is to add variables to hold what movement was done. The character can move either way horizontally and vertically. So, a variable for change along the x-axis and a variable for change along the y-axis are needed. Your act method will now look like this: <Code Omitted>Now, that dx and dy are there,
Problem with isTouching
By Dirgantara007, with 1 reply.
Replied to by Super_Hippo, over 8 years ago:
Reason for the error: The actor is removed from the world and then you are calling a method which requires the actor to be in the world (in this case 'isTouching'). When the actor is removed from the world, the current act method will be finished. I don't really know why you need this code at all. You earlier check for the intersection with the Alien. If you want it to be removed, then remove it there. The 'toRemove' variable also seems to be useless.
how to move to next level
By ali18, with 6 replies.
Last reply by ali18, over 8 years ago:
Thank you very much. This is working very well now.
Condense code
By Trystar360, with 15 replies.
Last reply by Super_Hippo, over 8 years ago:
My map should have been this (forgot all the commas)... <Code Omitted> It's up to you if you prefer numbers or letters, it should do the same.
Bullet removal error
By Kevroa, with 3 replies.
Last reply by Kevroa, over 8 years ago:
Ah, Thanks! Makes sense... don't know why I didn't think of that. Will try in a few minutes...
Chess network
By aleR, with 3 replies.
Last reply by Yehuda, over 8 years ago:
Are you trying to have two Greenfoot users play against each other on the website? Maybe
this scenario
will help you.
Spawn an actor randomly after a period of time
By GreenfootNewbie2000, with 1 reply.
Replied to by danpost, over 8 years ago:
GreenfootNewbie2000 wrote...
What do I have to do to do this action every 5 seconds
Count act cycles. Usually 300 act cycles is about 5 seconds. You can simply what you show above to this: <Code Omitted>
342
343
344
345
346
347
348
X