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
New idea, holding an object via space bar
By Moynzy, with 2 replies.
Last reply by Moynzy, almost 13 years ago:
public void Dribble() { Actor ball; ball=getOneObjectAtOffset(0,10,ball.class); if (ball !=null && Greenfoot.isKeyDown("space") ) { setLocation(getX()+4, getY()); //For the basic solution this is where you put your new code. } }
clock actor
By zwartepiet333, with 13 replies.
Last reply by danpost, almost 13 years ago:
Your Clock actor only registers seconds (not partial seconds). It would take a lot of work to fix this to what you want. Better would be to create your own timer system to suit your needs. Also, your TimeChecker class is really a waste of an actor and of a class. What it does should be done in your world class act method or a method that act method calls.
Reading Images from Files //no Greenfoot
By Kartoffelbrot, with no replies.
Hello guys, I have a java.io.File. It is an image (png or jpg). I know that I can read it with the java.io.FileInputStream so far. But how can I turn this byteArray into a java.awt.graphics or java.awt.image.BufferedImage instance?
Published programs working on Mac Book Pro
By jimboweb, with 3 replies.
Last reply by jimboweb, almost 13 years ago:
Thanks. What a pain. Guess I need to use mouse commands from now on.
Proximity and colour help wanted
By ScratchMan, with 8 replies.
Last reply by danpost, almost 13 years ago:
The changing of all the squares has to be synchronized. Just do both steps each act method. This would be accomplished by putting the code in your world class. (1) for all squares, determine next state (2) for all squares, set to next state Two back-to-back 'for' loops in the world act method would suffice. You will need either an instance field in the square class or a two-dimensional array in the world class to hold the next state -- the values of which are set by the first loop and used by the second to change the squares.
Kicking A Ball
By Moynzy, with 4 replies.
Last reply by Moynzy, almost 13 years ago:
Thank you for the comments, i scrapped the idea.
UserInfo - Multiplayer topics
By bourne, with 2 replies.
Last reply by bourne, almost 13 years ago:
Yes, you don't want to be calling the UserInfo methods like getTop(int) or store() in the main thread of execution if you don't want pauses with the scenario to the user. And I used a couple different threads for different purposes.
How to make multiple objects disappear?
By chrl98, with 3 replies.
Last reply by chrl98, almost 13 years ago:
Thanks both. :)
hey
By alosh, with 1 reply.
Replied to by erdelf, almost 13 years ago:
a for loop would solve it better i think <Code Omitted>if i got it right, it should spawn a new fish every 10nth cell in a while loop it looks like this: <Code Omitted>
cannot find symbol method canSee
By chrl98, with 8 replies.
Last reply by gnvrajareddy, almost 13 years ago:
Open the Unit class code editor and just modify the starting line of the class as public class Unit extends Animal
how to use getX and getY
By deathburrito16, with 3 replies.
Last reply by deathburrito16, almost 13 years ago:
ok figured it out now
How to make an object bounce of a Brick?
By UltimateCoder, with 5 replies.
Last reply by danpost, almost 13 years ago:
UltimateCoder wrote...
thanks, i used the 'isTouching' method. is that fine?
That should work.
pictures problem
By deathburrito16, with 2 replies.
Last reply by deathburrito16, almost 13 years ago:
thnks
Scoreboard not updating and detecting shots fired
By chrl98, with 6 replies.
Last reply by chrl98, almost 13 years ago:
Understood. Thanks guys! :)
How to pass direction?
By Victor0409, with 22 replies.
Last reply by Victor0409, almost 13 years ago:
Thanks
751
752
753
754
755
756
757
X