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
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 12 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 12 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 12 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 12 years ago:
Thanks danpost that works perfect now thank you so much
Need help
By silidor, with 8 replies.
Last reply by silidor, over 12 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 12 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 12 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 12 years ago:
Ofcourse... Thanks vonmeth. Stupid to think i could remove the object i was working in first >.> Great help :)
How to adding level ? how to use more than one world classes?
By fajrizarmy, with 4 replies.
Last reply by fajrizarmy, over 12 years ago:
great... thank you very much danpost :)
How to detect a color underneath a transparent image.
By Minion1, with 7 replies.
Last reply by kiarocks, over 12 years ago:
Just a small note, you can upload pictures somewhere and then attach them with (without spaces).
Help!
By JellyBlobsofDoom, with 5 replies.
Last reply by JellyBlobsofDoom, over 12 years ago:
Thanks for the help though! :)
Body hits wall and bounces back?
By kaciedy, with 3 replies.
Last reply by kaciedy, over 12 years ago:
Alright, thank you both! I have it fixed.
FOR LOOP EMERGENCY
By ImASuckerAtThis, with 5 replies.
Last reply by Duta, over 12 years ago:
Oh, fair enough.
890
891
892
893
894
895
896
X