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 Background
By DustTerminator, with 1 reply.
Replied to by danpost, over 9 years ago:
Please check out my
Scrolling Tutorial
scenario for information on making a scrolling world.
Where is my error
By asmith1998, with 1 reply.
Replied to by Super_Hippo, over 9 years ago:
Change the 'if' in line 55 to 'else if'. In the future, please provide the error message, so we don't have to guess what could be wrong. Btw, 'this' will never be 'null'.
Selecting units via a box
By LichKing, with 1 reply.
Replied to by danpost, over 9 years ago:
In my Conway''s Game of Life scenario, I implemented something similar to save an area of the grid. I had these parts: (the following maybe would be in your World subclass)
Calling a method from the World Class
By NickWood18, with 1 reply.
Replied to by danpost, over 9 years ago:
By 'call a method from the World class', I think they mean 'call a method that is defined in the World class'. The 'showText' method is defined in the World class. You can have your World object call it: <Code Omitted>or have an Actor object that is in the world call it: <Code Omitted>
Condensing multiple classes into one
By JeSuisFish, with 3 replies.
Last reply by danpost, over 9 years ago:
You just need an identifier in the combined classes (Tank, Turret and Shell) -- probably an int field to distinguish one from another (using values from zero to three). Add methods to the classes to return the identification number so that other objects can determine which they are.
Counter isn't counting!
By johnmir19, with 4 replies.
Last reply by johnmir19, over 9 years ago:
Thank you! I really appreciate it! I'll let you know if it works!
Possible to make changeable method and change it accordingly.
By nat12, with 1 reply.
Replied to by danpost, over 9 years ago:
Remove the line declaring bossHP from the boss class and the line declaring enemyHP from the enemy class. Then, wherever either is used in the two classes, change it (either 'bossHP' or 'enemyHP') to just 'hp'. Finally, declare 'hp' in the superclass and change 'VARIABLE' to 'hp' in that class as well. In other words, you want to declare 'hp' for all instances of the superclass (which include instances of its subclasses) in the superclass. Any methods you might have to adjust the value of the health in the subclasses can also be move into the superclass. Each subclass can set its own st
objectsatoffset -> return??
By LegendofLife, with 6 replies.
Last reply by danpost, over 9 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 9 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 9 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 9 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 9 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 9 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 9 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 9 years ago:
The loop is what is causing multiples to be spawned at once. Use an if statement with a random chance to spawn.
343
344
345
346
347
348
349
X