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
Using input from user to change an image
By stefi, with 8 replies.
Last reply by stefi, almost 10 years ago:
Thank you!!:)
Problems with moving in an uploaded scenario
By jogit666, with 4 replies.
Last reply by jogit666, almost 10 years ago:
Yes, I realized. And never mind, it works on a different computer, I guess its a mac/safari problem.
Movin to a Target in ONE Straight Line.
By tobias1798, with 1 reply.
Replied to by danpost, almost 10 years ago:
Take a look at my
Radial Graphs
scenario. It will show you the possible direction (angles of movement) that are possible with different speeds of your actor using 'move'. To move in a straight line, you would either have to track the location of the actor using 'double' values (like the SmoothMover class does) or you can hold the initial location coordinates in fields and use a counter to move the new distance from the original location, with code similar to the following:
Specrtometry: Converting Pixels to Spectrum
By Mkheo, with 1 reply.
Replied to by davmac, almost 10 years ago:
A google search on "rgb to spectrum" showed some interesting-looking results so you might want to try that. Note that you can't convert all RGB combinations into a single wavelength, because some colours are made up of more than one frequency of light.
Animal class
By nona, with 2 replies.
Last reply by nona, almost 10 years ago:
danpost wrote...
Use the menubar and select "Edit>Import class...", choose 'Animal' and click the 'Import' button. Then change what your Actor subclass extends to 'Animal'.
thank you
Is their a way to transfer health from one world to another
By kzg0015, with 1 reply.
Replied to by danpost, almost 10 years ago:
What is the code you used to create and set the new world active?
Pattern not work Help!
By NINJAGO_KAi, with 7 replies.
Last reply by NINJAGO_KAi, almost 10 years ago:
once again thank you danpost
Detecting a certain number of hits
By patrick26, with 2 replies.
Last reply by danpost, almost 10 years ago:
Instead of detecting the Plant object from within the Fireball class, detect the Fireball objects from the Plant class and put the counter there (since the counter represents the 'health' of the plant). Anyways, by having it in the Fireball class as a non-static field, each fireball object set its field value to zero, increments it to one when intersection occurs, and then the fireball is removed, which makes the fireball and its fields destined for garbage collection.
Ping Pong
By vdk, with no replies.
I'm making a kind of pingponggame and I want that if the computer or the player has a score of 5, game over appears. This is my code for my counter... import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo) import java.awt.Color; public class Counter extends Actor { public LeftBat linkerbat; public RightBat rechterbat; private static final Color defaultColor = new Color(255, 255, 255); private int count_score = 0; public void act() { setImage(new GreenfootImage(linkerbat.getScore() + "-" + rechterbat.getScore(),30,Color.BLACK,null)); gameOver(); } public Counter(LeftBat lb, RightBat rb) { linkerbat = lb; rechterbat = rb; } public void gameOver() { if ( if (count_score ==5) { Greenfoot.stop(); } } }
How to open a path with Greenfoot?
By Rudolf, with 4 replies.
Last reply by Rudolf, almost 10 years ago:
Thanks a lot davmac, but its almost that what I want to do. It works just like a save Button. What I am searching for is an option to open a Folder and then open the files, doc,txt or Internetlinks with Word or Notpad or with my Browser. I want to open only the path, then I want to open the files without Greenfoot, just like i´m workin with my computer and open the folder himselfe step by step :)
problem with at world edge method help me plz
By nona, with 4 replies.
Last reply by danpost, almost 10 years ago:
nona wrote...
well it's only work at on edge
I am not sure I understand. What are you wanting the actor to do and how is it not doing it?
android
By nona, with 1 reply.
Replied to by Zamoht, almost 10 years ago:
Take a look at
this discussion
.
Main Menu
By BD289, with 2 replies.
Last reply by danpost, almost 10 years ago:
I do not see where 'Keys' or 'Keys2' are being declared anywhere within the class.
Score Counter after enemy death
By PaisleyAinsley, with 3 replies.
Last reply by PaisleyAinsley, almost 10 years ago:
This worked! Thank you so much for your help and explaining it in a way that helps me understand!
Directory Pathing
By LegendXV, with 4 replies.
Last reply by danpost, almost 10 years ago:
There is a 'sounds' file in the project folder also. Ensure the sounds are included in it; name them properly and refer to them in your code with the same names; also, ensure there are no informations tags within the sound files (author, title, etc.) as they can mess with the processing of the file within greenfoot (I think an IndexOutOfBoundsException occurs).
685
686
687
688
689
690
691
X