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
Sprites Movements !!! NEED HELP IMMEDIATELY PLEASE :(
By SpritesKing, with 5 replies.
Last reply by SpritesKing, almost 13 years ago:
btw i already fixed that problem thanks :)
fallUntilGround
By moobe, with 9 replies.
Last reply by moobe, almost 13 years ago:
OK, it doesn't matter, it works fine since my third post. But it isn't a nice style ;)
Timer to stop game after 60 seconds or something
By danbyization, with 17 replies.
Last reply by danbyization, almost 13 years ago:
No i didnt but now i have and it works fine thank you so much for helping me i really appreciate it
how to get acces of the World class with an actor class
By schoki7, with 1 reply.
Replied to by danpost, almost 13 years ago:
To access a variable in your
sub-class of World
(not the World class, which is the super-class of the world where you placed the variable), You need to cast what is returned with 'getWorld()' to that which you named your sub-class of World. If your sub-class of world was named 'MyWorld', then: <Code Omitted>provided that the variable has public
Problem with deleting an object at a certain time
By zakariaonlyy, with 5 replies.
Last reply by zakariaonlyy, almost 13 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, almost 13 years ago:
Great, i get it. Thanks :D
Does anyone have a snake game?
By behappy2, with 3 replies.
Last reply by danpost, almost 13 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, almost 13 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, almost 13 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, almost 13 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, almost 13 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, almost 13 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, almost 13 years ago:
Thanks danpost that works perfect now thank you so much
892
893
894
895
896
897
898
X