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 get only the r value of a color
By JetLennit, with 2 replies.
Last reply by JetLennit, almost 11 years ago:
Thanks
How to check the colour of a pixel in an image, then change it?
By K_wow, with 2 replies.
Last reply by K_wow, almost 11 years ago:
davmac wrote...
Line 14 uses reference equality (the == operator) to compare the oldColour object with the colour object returned by getColorAt(). Even if the two objects specify the same colour, there's no guarantee that they'll be the same object. You should use .equals(...) for this check rather than the == operator. if (image.getColorAt(currentPixel, y).equals(oldColour)) ...
Thankyou, it works perfectly!
PDF format Book For GREENfoot
By doughauf, with 2 replies.
Last reply by dangjavageek, almost 11 years ago:
Safari Books Online appears to carry the Greenfoot Book (http://greenfoot.org/book) and if you have a public library account, some libraries appear to have a relationship with Safari Books Online so that you can use that as a way to read / reference the book as needed. There's also an option to buy the e-book.
Can we display timer in a game?
By Kaiwalya, with 15 replies.
Last reply by danpost, almost 11 years ago:
I came up with the following for the CountDown class:
Greenfoot character moves through walls only horizontally?
By brandondamante, with 1 reply.
Replied to by danpost, almost 11 years ago:
If you save in a local field (or fields) the original direction of movement, then check for intersecting object, then when intersection found, move back in the opposite direction to move back off the object. Also, using this way you do not needs all those checks.
special attack types
By darkmist002, with 4 replies.
Last reply by darkmist002, almost 11 years ago:
thanks, was hesitant about using loops b/c of what i had read. glad i asked you guys about it, otherwise i won't have even tried loops.
getting hp to scale with waves
By darkmist002, with 11 replies.
Last reply by darkmist002, almost 11 years ago:
that works, thanks. can't believe i didn't think of something that simple. guess i got so caught up by using modulus division i forgot about regular lol.
Changing colour of a fillRect(x1,y1,x2,y2)
By 8bitorangejuice, with 8 replies.
Last reply by 8bitorangejuice, almost 11 years ago:
Oh and as for the question: I am using a static int :)
main menu + keeping the score. help!
By Icecold, with 7 replies.
Last reply by Skylander85, almost 11 years ago:
thx
i need help uploading my scenario
By JayWood860, with 15 replies.
Last reply by davmac, almost 11 years ago:
How did you fix it? If others have the same problem it will be useful for them to know.
How to erase previous drawn images?
By AceticAcid, with 5 replies.
Last reply by Zamoht, almost 11 years ago:
Oh I didn't get that the whole thing was made in one GreenfootImage.
Methods with optional values?
By Entity1037, with 3 replies.
Last reply by Zamoht, almost 11 years ago:
Sorry for my late answer. I guess you already found out but yes it is possible and it will work.
CHALLENGE 3 | June 2013
By FlyingRabidUnicornPig, with 59 replies.
Last reply by steved, almost 11 years ago:
thanks
Getting one object of certain class via coordinates
By Segara, with 3 replies.
Last reply by danpost, almost 11 years ago:
Segara wrote...
Well, as you saw in the code, I do create objects of A class, but don't save them anywhere.
I matters not whether you have saved them or not, or even whether you create and add them to the world or not. If the method does not find any objects of the given class whose image overlaps the location given, then the method will return null. It is the location that is important. If you place a Back object at location (8, 8), then using getX() (or getY()) in the back class will return 8 for that Back object. If you use 'getOneObjectAtOffset(4, 4, null)' for that Back objec
.JAR file in Java
By doughauf, with 3 replies.
Last reply by davmac, almost 11 years ago:
If you install Greenfoot you will find various jar files in the installation. At least the main one, greenfoot.jar, will be necessary for building scenarios externally. You will not easily be able to run your scenarios from outside Greenfoot. That's about as much information as I can give you, as building scenarios outside of Greenfoot isn't something we really support. Someone else may be able to offer help.
800
801
802
803
804
805
806
X