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
HealthBar Help
By DMCGames, with 4 replies.
Last reply by AwesomeNameGuy, over 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, over 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, over 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, over 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, over 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, over 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, over 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, over 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
Greenfoot Greeps
By bobbythewhale, with 1 reply.
Replied to by davmac, over 14 years ago:
Please don't share Greeps code and please don't ask for Greeps code. The Greeps scenario is used as a competition in classrooms. You are meant to experiment to figure out how to improve the Greep performance. It's fine to ask for help with other scenarios - but not Greeps.
How to spit paint trails of greenfoot greeps?
By bobbythewhale, with no replies.
*ON ..Can anyone help me with this?
Game crash need help!
By FatCat, with 5 replies.
Last reply by darkmist255, over 14 years ago:
Maybe call getWorld().konecIgre(someVariable) and have someVariable be the number?
Galaga Help
By NathanH, with 10 replies.
Last reply by NathanH, over 14 years ago:
Mine is telling me that it can't connect to its host. It might be because I'm on a school computer. We have everything fixed now and we're back on track. We've got all of our aliens working and everything else. We're currently trying to get the aliens to shoot back at us now. Thanks for all of your help though and be willing to help.
Problem with Act() method in sprite class
By mal, with 5 replies.
Last reply by mal, over 14 years ago:
OK, the class doesn't extend actor, it's a completely new class, I added the Act() method myself under the assumption that it would be called automatically. I've changed it to updateSprites() and now call it from the World. Hi danpost, we decided on using a spriteFactory to represent our images so we would only have one instance of each image required for the game, then we reference that image in whatever actor requires it. Each sprite can have up to 11 images (currently) that increment every time act is called. without the spriteFactory we could be looking at loading up to 17 image
Declaring a color variable
By carterfootball, with 1 reply.
Replied to by darkmist255, over 14 years ago:
Yup. Just say something like <Code Omitted>
1025
1026
1027
1028
1029
1030
1031
X