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
Dynamic variable for setWorld
By Knet, with 5 replies.
Last reply by danpost, almost 11 years ago:
Knet wrote...
there will be so much code in one class if I add many maps, which I don't like.
With my Level class, each subclass would be able to set its own fields (map data included) and determine which level to proceed to. Since the fields and methods are located in the Level class and methods are overridden in the subclasses, it is not necessary to know what level is currently active (no extensive 'if-else-else-else' statements -- in fact, not even one 'if' after determining that a particular level change is required).
I am trying to add a scoreboard to my gamer, but it gives me an compiling error saying cannot find variable - variable scoreboard
By Javanovice, with 2 replies.
Last reply by Javanovice, almost 11 years ago:
Thanks Dan, it worked!
How to change the color of an object in Boids
By Wolfpack797, with 1 reply.
Replied to by danpost, almost 11 years ago:
You are showing these lines of code: <Code Omitted>Line 1 has two issues. One is that the 'getImage' method is not a member of the World class and it does not appear to be included in this Sky class. The other issue is that 'Greenfoot Image' should not have the space in the middle of it. The problem with line 2 is that the variable 'image' is not declared anywhere. By the name of the variable, I would presume it would hold a GreenfootImage object; but, 'color', the method you are calling on this object, is not a member of the GreenfootI
Sound Problems
By MeeyaHatake, with 2 replies.
Last reply by Super_Hippo, almost 11 years ago:
Keep a reference to the music when you create it and stop this music then. Do not create a new GreenfootSound object when you want to stop the other.
School Project!!Need some Ideas
By Sepho, with 1 reply.
Replied to by Super_Hippo, almost 11 years ago:
For me, the most difficult part of programming is getting ideas of what to do. If you have something in your head which you want to do, go for it. Do it in small steps and at the end, you will achieve more than you thought at the beginning. If you have trouble with certain parts, you can ask for help here.
Greenfoot Piano Part 5
By andrewstouse, with 1 reply.
Replied to by Super_Hippo, almost 11 years ago:
1. Use code tags when posting code! 2. whitekeyWidth is in the code only once. (Same with blackkeyWidth.) The questions are: Do you need this variable? If yes, for what? You could write 'private int whitekeyWidth, blackkeyWidth' outside methods if you want to save the values to these fields.
help what is wrong with this
By itwasntme123, with 3 replies.
Last reply by Super_Hippo, almost 11 years ago:
The method is named 'isFood'. But the method gets
another
object of the passed class at the same position as this object and if there is one, it returns 'true' (and 'false' if not). If you want to check if an object is an instance of the Food class (which would make sense since the method was called 'isFood'), you could use 'instanceof'.
Error - Scrolling the world
By pintoo, with 2 replies.
Last reply by danpost, almost 11 years ago:
You are trying to control the scrolling of the world from an Actor subclass. Although this may be possible to do, it is not the best way. Code your actor to move as you want (falling and springing as needed) without regard to the world itself. Then, in the world class, determine what scrolling is needed and scroll everything there. Keeping a reference to the doodler in the World class will help immensely in the coding.
Compile error: package com.sun.jna does not exist
By Christoph, with 6 replies.
Last reply by Christoph, almost 11 years ago:
Does greenfoot need wunderground-core.jar to work correctly?
How to...?
By iCodeAsian, with 2 replies.
Last reply by iCodeAsian, almost 11 years ago:
That's weird the code didn't show
Need help making Vertical Scroll camera with danpost's scrollworld
By Vishis, with 1 reply.
Replied to by danpost, almost 11 years ago:
Vishis wrote...
<Image Omitted> I cannot make the camera follow the wombat vertically and i have to scroll the world myself. I did make the world a subclass of sworld and im not sure how to set scroll type to 2 for vertical scrolling, please help!
Why wont my scoreboard work?
By iCodeAsian, with 1 reply.
Replied to by iCodeAsian, almost 11 years ago:
Fixed it. Don't respond
someone please help!!!!! countdown timer
By alli, with 3 replies.
Last reply by danpost, almost 11 years ago:
You should probably show the class of the timer also. As a sidenote, my
Value Display Tutorial
might be able to help you along.
Removing a specific object
By Chapaladeen, with 3 replies.
Last reply by danpost, almost 11 years ago:
Most of it deals with keeping a reference to the button actors (having fields in your world class that hold the buttons). Then the world act method can be used to perform the necessary actions on the buttons.
problem with eating a flower
By noorinrahila, with 1 reply.
Replied to by danpost, almost 11 years ago:
Normally, the method that goes along with the 'eat' method is called the 'canSee' method. These methods are found in the Animal class. You might just try using the 'isTouching(Class)' and the 'removeTouching(Class)' methods which are already a part of the Actor class which do basically the same thing.
520
521
522
523
524
525
526
X