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
How do I add Text to a world?
By Keyblade37, with 1 reply.
Replied to by bourne, over 10 years ago:
Look into the GreenfootImage class, either its constructor or drawString method: (The GreenfootImage then could be set to an Actor that is added to the World) GreenfootImage(java.lang.String string, int size, java.awt.Color foreground, java.awt.Color background) drawString(java.lang.String string, int x, int y)
Playing Music
By jennifer56, with 1 reply.
Replied to by Yogibaer, over 10 years ago:
See the discussion
multiple Worlds
How can I make an object bounce off the walls going left to right?
By Lautima, with 4 replies.
Last reply by Yogibaer, over 10 years ago:
A good solution: look the thread: "Help! with switching Actor directions?" a few steps down. (postmaster, please delete my previous posting)
End Breakout Game
By hdeforest, with 4 replies.
Last reply by hdeforest, over 10 years ago:
.
Passing Parameters Between Worlds
By Adept_Red, with 15 replies.
Last reply by Adept_Red, over 10 years ago:
HE CAN BE TAUGHT!!! Just tested it out by adding a System.out.println in the HS_controller and it successfully printed the score.
Thank you guys so much for your help!
There is of course the issue that HS_controller wont draw anything on the screen like it should... but the hardest part for me has been resolved. Here is the code as it is:
using a class parameter with setWorld() method
By jkc1113, with 2 replies.
Last reply by davmac, over 10 years ago:
Really, you should use the
factory pattern
and pass in a factory instance instead of a class. However, this also works: replace line 05 above with the following lines: <Code Omitted> As you can see it is a bit messy, la
different end screens?
By chrissy098, with 1 reply.
Replied to by danpost, over 10 years ago:
Have your actor count how many bonuses were picked up and use its value to determine which end screen to use.
Conditions for new level
By DoctorProfessorYoshi, with 31 replies.
Last reply by DoctorProfessorYoshi, over 10 years ago:
I think, and this is just pure speculation here, but try putting the score widget in the code that tells the computer what to put in each level.
Writing and Reading from file help
By Hoshiwara, with no replies.
I am creating a electricity simulator (not to be uploaded) and I made it so it can write and read to file (so it can save the current circuit for when you next load up the program). Once I got this working I exported it to a .jar file for testing, and in that form it will not read/write to the files. I can see the files in the jar file when I open it with an archive program, however, they do not seem to be changing. I'm not sure if the code is necessary, if you need it just ask.
character walking help
By chrissy098, with 6 replies.
Last reply by chrissy098, over 10 years ago:
changed it to 40 and it looks pretty good..... what code would i use to make it work when he walks and stop when he does....
Shooting in the direction the direction
By pr2alede, with 1 reply.
Replied to by danpost, over 10 years ago:
Use the 'addedToWorld' method to set the rotation of the ant to that of the crab when the ant is added to the world. Then, change the movement code (lines 26 through 29) to using the 'move' method to move.
breaking objects
By Olaf144, with 2 replies.
Last reply by Olaf144, over 10 years ago:
Together with this one: private void checkblok() { blok = (blok)getOneIntersectingObject(blok1.class); if(blok != null){ if((getY() > blok.getY()) || (getY() < blok.getY())){ deltaY = -deltaY; } else{ deltaX = -deltaX; } if(blok instanceof blok1){ blok1 blok1 = (blok1)blok; if(blok1.isZero()){ ((Background) getWorld()).breakblok(); } } blok.collide();
Starting and stopping the sound
By Foppen, with 4 replies.
Last reply by Foppen, over 10 years ago:
Alright thanks.
Score System
By alagon, with no replies.
I know this is being posted a lot...but... Im trying to increase a variable in another class without creating a new class every time. My class that im trying to increase the variable class is the bomb and the score system...Score i guess. Currently what im using is: <Code Omitted> (I use a method that takes the score and adds it to the already existing score.)
java.lang.NullPointerExpection
By joe.colo1, with 4 replies.
Last reply by bourne, over 10 years ago:
Depends on context. But make sure it is initialized before trying to invoke it (calling methods on it). private Swag swag = new Swag(); // Or whatever constructors you have for that class
750
751
752
753
754
755
756
X