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
Problem with deleting an object at a certain time
By zakariaonlyy, with 5 replies.
Last reply by zakariaonlyy, over 11 years ago:
It worked perfecty thank you Dan :) Actinium also thanks for your response mate
Repeating missile shot, delayed.
By Mindlezs, with 5 replies.
Last reply by Mindlezs, over 11 years ago:
Great, i get it. Thanks :D
Does anyone have a snake game?
By behappy2, with 3 replies.
Last reply by danpost, over 11 years ago:
I have several demos for snakes. Click on my picture icon (the fractal image) and on the lower right you will see my Collections. Go to the 'Demos by danpost' collection and check out the 'Snake Tracks Demo' specifically; as that one eats food to grow. I would also suggest looking at the others for different ways for the body segments to play 'follow the leader'.
Programming error
By drewleighton, with 1 reply.
Replied to by Duta, over 11 years ago:
If you get that error, then you've attempted to create a method that returns a value ...but you've never returned a value. For example: <Code Omitted> ^This would give an error, as you need to return a value. The method should be this: <Code Omitted> If you are creating a method with "void" return type, then it doesn't return a value, and so you do not need a return statement. You
can
put return statements in a method with "void" return type - this will
can somone tell me whats wrong with this code please.
By theuberjew, with 16 replies.
Last reply by danpost, over 11 years ago:
In order to work with List object, the List class must be imported into your class with <Code Omitted>However, this would be more to the point and not require importing java.util.List: <Code Omitted>Knowing where to go to find what methods are available is of the upmost importance. You do not neccessarily have to learn each method inside and out. Just knowing that there is a method that does a specific thing is enough, because then you just go back to the information on it and ut
Turn to Face
By SunnyD212, with no replies.
In my program, I have a frog (the player) that eats flys and a ladybug that patrols the area; if you touch the ladybug you loose. My ladybug moves at random in any direction as the program runs, however I don't know how to have my ladybug turn to face the direction it is moving. If it decides to run to the left, it will continue to face right. It will stay facing right no matter the direction it starts to move in. Can anyone help me turn this ladybug around?
Turn Towards (Help)
By u15ahernandez, with 4 replies.
Last reply by u15ahernandez, over 11 years ago:
Oh.. Okay. A sort of reference like a scoreboard would have? Thanks c:
help with creating flowchart for greenfoot robot
By lewis4lfc@gmail.com, with no replies.
Hi Guys I have created a Greenfoot robot for my university assignment as described below using the following code: import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo) /** * Write a description of class robot_1 here. * * @author (your name) * @version (a version number or a date) */ public class robot_1 extends Actor { /** * Act - do whatever the robot_1 wants to do. This method is called whenever * the 'Act' or 'Run' button gets pressed in the environment. */ public void act() { int x = getX(); int y = getY(); //setlocation(x + 1, y); if (Greenfoot.isKeyDown("f")) { move (4); } if (Greenfoot.isKeyDown("b")) { move (-4); } if (Greenfoot.isKeyDown("l")) { turn(-3); } if (Greenfoot.isKeyDown("r")) { turn (3); } } public boolean foundBomb() { Actor bomb = getOneObjectAtOffset(0, 0, bomb_1.class); if(bomb != null) { return true; } else { return false; } } } keys to control robot movement F=Foward, B=Backward, L=left & R=right & here is a video of my robot:http://www.youtube.com/watch?v=IuixdHDPD24 For this Assignment my task is to use Greenfoot, I have been provided with a scenario, as part of this scenario I will have to produce a routine which will control a robot, this robot will be able to navigate across the table & push the bomb by pushing it into the red brick square, The robot will carry the bomb and will be controlled via the keyboard using keys for different directions The bomb and robot is allowed to go through and out of the square in the basic solution only. Must use the scenario provided For the basic solution this must be done within the act() method within the robot class. This report will cover: • What I did throughout the whole assignment • Flow charts • Test plans Does anyone know how I am supposed to create a Flowchart for this Greenfoot robot Using flowchart software QSEE Superlite?, as I do not get how to create a flowchart following this document: http://www.sendspace.com/file/xk8iid thanks
help!
By popiroprios, with 3 replies.
Last reply by danpost, over 11 years ago:
I am getting lost in your code. You are using more fields than are neccessary; you have multiple places where the actor gets re-located; your variable naming is cryptic; and you have nothing really working in your code (animation does not seem to work; I could not say what half the 'if's are checking or what their block do; you have some code that could be simplified and some variables that are useless -- count and conti). You may want to start fresh. Maybe create another sub-class of Actor called 'Mario' (with a capital M) and built it up; each time you add something, make sure it works be
Color stays same after hit, but I want to revert back to original.
By kaciedy, with 4 replies.
Last reply by kaciedy, over 11 years ago:
That makes way more sense than it did before. Thank you a lot!
Score Counter increment each time mouse clicked
By danbyization, with 9 replies.
Last reply by danbyization, over 11 years ago:
Thanks danpost that works perfect now thank you so much
Need help
By silidor, with 8 replies.
Last reply by silidor, over 11 years ago:
Dude i love you ♥ Thank you very much :)
how do you stop sounds
By Ploppy, with 1 reply.
Replied to by danpost, over 11 years ago:
If you use the GreenfootSound method to start the music, you can stop it with the corresponding GreenfootSound method (provided you keep a reference to the GreenfootSound object). However, if you use the Greenfoot 'playSound' method to start background music, only resetting the scenario will stop it (unless you have it starting in the initial world constructor, in which case it will only re-start the music).
Sounds
By Ploppy, with 3 replies.
Last reply by danpost, over 11 years ago:
The file needs to be re-formatted as that type of file (mp3). Just changing the extension of the name will cause the program that loads the file to expect a certain format for which is was not written in. Change the filename back to what it was. Open it with a music player/editor and save it in the format you wish it to be in (be sure to remove any tags that may be in the file when saving it).
Deleting object from world after mouse drag error.
By Timververs, with 3 replies.
Last reply by Timververs, over 11 years ago:
Ofcourse... Thanks vonmeth. Stupid to think i could remove the object i was working in first >.> Great help :)
881
882
883
884
885
886
887
X