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
Removing all objects
By bbwf, with 21 replies.
Last reply by danpost, almost 13 years ago:
'return;' is just a statement that causes an immediate exit from the method that is currently executing. Placing it in your code prevents later statements in the method from executing.
How to get the Greep/Alien to go back to the ship after they get the tomato?
By sask_girlz_rock, with no replies.
I have got the alien to get the tomato, bounce off the water and only a few return back to the ship. how can get it to return to the ship without the command saying return to ship?
How do you get the score to reset when you reset the game?
By theuberjew, with no replies.
me and my friend are stuck on this.
Whats the code for putting a timer in greenfoot if there is one?
By theuberjew, with 2 replies.
Last reply by theuberjew, almost 13 years ago:
thanks figured it out
Light Cycle AI
By m.legere1323, with 5 replies.
Last reply by wafflepudding, almost 13 years ago:
oh okay. thanks man I'll go there
Click to add objects
By super_noob, with 6 replies.
Last reply by Zamoht, almost 13 years ago:
I guess you could add my code to the world's act() method like this. public void act() { if (Greenfoot.mouseClicked(null)) { MouseInfo mouseInfo = Greenfoot.getMouseInfo(); int x = mouseInfo.getX(); int y = mouseInfo.getY(); addObject(new WhatEverClass(), x, y); } }
Delaying An Actor
By marzukr, with 3 replies.
Last reply by marzukr, almost 13 years ago:
Never mind I fixed this by decreasing jp to -16. Thanks.
adding a counter and making it work
By ctgreenfoot, with 1 reply.
Replied to by vonmeth, almost 13 years ago:
Find the code in the Crab class (it should be in a method that looks for the worm) where the crab 'eats' the Worm class. You will want to assign a new value to your counter there. Something like, " counter = counter + 1; ", or you can simplify that line and use the increment operator - "counter++;" - that will increase the counter by 1.
Shooting Problem
By Motifaded, with 3 replies.
Last reply by Motifaded, almost 13 years ago:
I fixed the problem.
How to detect what object is currently using a global method?
By UnclePedro, with 2 replies.
Last reply by danpost, almost 13 years ago:
I think that all you need is to put an instance boolean variable in the Enemy class, call it 'reversed'. Each object created from that class or any subclass will have a copy of that field for its use. You can also add the following method within the Enemy class to return the state of any object of that class (or subclass): <Code Omitted>Just change the state of the 'reversed' field every time you turn the object around.
Leaves and Wombats - Random Leaves
By Gruff757, with 4 replies.
Last reply by Gruff757, almost 13 years ago:
It works now. Thanks a lot vonmeth! =)
Add Object Question
By mncomic, with 8 replies.
Last reply by mncomic, almost 13 years ago:
Thanks everyone for your help...
Creating Objects
By Johnathon, with 6 replies.
Last reply by Zamoht, almost 13 years ago:
Oh of course. To be honest I didn't understand the question, but danpost's code is definitely an easier way to approach this problem.
why does this not work?
By theuberjew, with 12 replies.
Last reply by theuberjew, almost 13 years ago:
Thank you for all your help my program runs fine now
Track skeleton on Greenfoot
By swapthomas, with no replies.
Hi, I installed the Kinect successfully. It has tracked my skeleton. I imported some of the Greenfoot examples that was on the Kinect page. How do I get my skeleton to appear on the Greenfoot console? Regards,
909
910
911
912
913
914
915
X