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 to make an image black and white?
By DerriQ, with 2 replies.
Last reply by Busch2207, about 14 years ago:
try this code: <Code Omitted>
How to solve it: java.lang.IllegalStateException: Actor not in world.
By b321234, with 5 replies.
Last reply by kiarocks, about 14 years ago:
Another idea is to remove the object at the end of the act() method.
need help
By programmer22, with 4 replies.
Last reply by mjrb4, about 14 years ago:
Or of course manage the indentation properly as you go, in which case you don't tend to run into problems like these nearly as much...! :)
Interesting Error
By AwesomeNameGuy, with 7 replies.
Last reply by kiarocks, about 14 years ago:
I like crazy code!
OMG I'm stuck with some basic stuff!!! HELP ME PLZZ!!
By b321234, with 4 replies.
Last reply by darkmist255, about 14 years ago:
Great :D!
enemies
By jonnyo98, with 5 replies.
Last reply by darkmist255, about 14 years ago:
Great!
HealthBar Help
By DMCGames, with 4 replies.
Last reply by AwesomeNameGuy, about 14 years ago:
Or you can do this: <Code Omitted>That way you don't have to draw 20 different images. This creates a red health bar inside a black rectangle that is 20X100 pixels in size. Gotta import java.awt.Color; to use Color.
Button or Key down that leads to a website url?
By minecraft15, with 1 reply.
Replied to by mjrb4, about 14 years ago:
You could potentially use the browse method on the desktop class: http://docs.oracle.com/javase/7/docs/api/java/awt/Desktop.html ...but bear in mind this won't work on the gallery. It's probably best just to display a link!
Greenfoot Chapter 7 Problems
By drumstick93, with 2 replies.
Last reply by drumstick93, about 14 years ago:
that actually helped alot, and worked really well...but it's an end of the year project I'm doing and I thought I should take it a step further. So instead of basing a change of level off the asteroids, I thought I'd base it off of the score, so i can have multiple levels. I know I need to assign a variable to the counter so i don't get the non-static method error, but I'm not sure how to do so. private void NewLevel() { Counter counter = Counter.getValue(); if (counter == 69) { Greenfoot.sto
quick question
By suushi, with 12 replies.
Last reply by suushi, about 14 years ago:
whew! ok. thank you very much!
How to make a "Check for Updates" Button
By minecraft15, with no replies.
Ok, so I have created a video game. I am putting this video game up on my website where users can purchase it. Now, I would love to know how I can implement either a Check for new version updates button, or an auto detector for a new version of the game. Is this even possible to implement into a green foot game or Java in general? Thanks to anyone that helps.
project help
By suushi, with 5 replies.
Last reply by suushi, about 14 years ago:
if ( Greenfoot.isKeyDown("2")){ if (Greenfoot.isKeyDown("2")) isLooping = !isLooping; if (isLooping) { java.awt.Color a; int r = Greenfoot.getRandomNumber(255); int g = Greenfoot.getRandomNumber(255); int b = Greenfoot.getRandomNumber(255); int x = Greenfoot.getRandomNumber(this.getWidth()); int y = Greenfoot.getRandomNumber(this.getHeight()); int x1 = Greenfoot.getRandomNumber(this.getWidth()); int y1 =
help me
By spooky, with 3 replies.
Last reply by mjrb4, about 14 years ago:
You'd do well to follow the tutorials here: http://www.greenfoot.org/doc They'll take you through the interface for Greenfoot and start you off with some basic coding.
New to this - non-static method cannot be referenced from static contex
By sausagefingers, with 2 replies.
Last reply by mjrb4, about 14 years ago:
CrabWorld in this example is your class - you could create a thousand different CrabWorld objects as far as Java is concerned and that would be perfectly legitimate. A method like addObject() needs to be called on a specific instance of CrabWorld, which in this case is what getWorld() returns (the world that's currently active in the scenario.) If you call it on the CrabWorld class instead, the compiler has no way of knowing whether you want the method called on one world object, which world object, or whether you want it called on all the CrabWorld objects! From the compiler's perspective
healthbar help
By diy_surgery, with 1 reply.
Replied to by delmar, about 14 years ago:
You need to access the player object from the Healthbar object. Or the other way around. Either you make a method in Player that returns the health value, e.g. public int getHealth() { return health; } and then call player.getHealth() from your Healthbar object. But you have to work out how to access the player
object
(not the class) from your Healthbar object. Or you make a method in Healthbar: public void setValue(int value) { currentValue = value; } and call that method from player whenever the value changes. Again, you
1024
1025
1026
1027
1028
1029
1030
X