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
Overlapping Of Pictures (Gif)
By Karsten, with 1 reply.
Replied to by danpost, about 7 years ago:
Karsten wrote...
when I implement the gif, the different images overlap (so that when the character is running 2 then 4 then 6 and finally 8 legs appear). << Code Omitted >> I have implemented the default GifImage class.
The problem may be a
World
subclass one. Show its codes.
Passing variable in World to an actor
By pawr, with 4 replies.
Last reply by pawr, about 7 years ago:
ScaleFlaw89 wrote...
If you are trying to put that as the name of the college, wherever you declared the name (for ex: collegeName) you would need to do <Code Omitted> Hope this helps. Took me awhile to figure this out myself :P
uhm... how do I get the stored input in the variable college and call the variable in an actor? for example: //in the actor setText("College: "
Fuel Display and End
By Celesterra, with 3 replies.
Last reply by Celesterra, about 7 years ago:
I figured out how to get it to work. Thanks for the help anyway!
make game over screen when my healthbar reaches to 0
By gdrgnxxi, with 5 replies.
Last reply by Super_Hippo, about 7 years ago:
You already have the condition. So you can add: <Code Omitted>Then you need to have a World subclass named GameOver, put the image as the background or do whatever you want to do in that world.
Getting an action in one class to interact with another class
By Thomasthedood, with 3 replies.
Last reply by Super_Hippo, about 7 years ago:
You could check which image is shown right now. If it is one specific image (or even if it is playing the animation at all), check if the actor is intersecting the opponent.
Actors as parameters
By MRCampbell, with 5 replies.
Last reply by Super_Hippo, about 7 years ago:
If you have an actor as the parameter, then you would add this actor several times. An actor can only be in a world at one position at a time. You don't want to add one object several times, you want to add several objects of a class.
Invaders (actors) are null when get by a getter in a world method.
By Notted, with 3 replies.
Last reply by Super_Hippo, about 7 years ago:
Then "inv" will stay "null" because it is never changed. Keep the HP of the Invaders in the Invaders class.
I Cannot Get My Character To Stay Within The World Without Crashing The Program
By ScaleFlaw89, with 3 replies.
Last reply by danpost, about 7 years ago:
You check it just like checking loc. Just replace loc with next.
About Green foot Creating images
By bbishal69, with 5 replies.
Last reply by danpost, about 7 years ago:
bbishal69 wrote...
Hey danpost, I could not figured out on this as you said, "You need to build a bar image also and combine them by drawing both the text and bar images on an image sized to contain both. Then set that as the image of the actor." Could you help me on how to build a bar image please? Thanks Bishal
danpost wrote...
Please refer to my
Value Display Tutorial
scenario.
issues with modifying variable when using custom text
By ErasedBlade, with 11 replies.
Last reply by Super_Hippo, about 7 years ago:
You call "loseHealth(1)" from the act method of Level 1 which reduces hpE by one every act cycle. But apparently your getter method is already doing that as well. (A getter method should only get the value without changing it so you can get it whenever you want.) It is really weird that you have the variables in your world class. Just imagine you have more than one Enemy, but one variable in the world class trying to make sure all enemies are acting correctly... For the two hpE variables. I can't see anything which could cause it from the code you posted. Maybe there is a duplicate in Screen
The Future of Greenfoot
By peanut1001, with 1 reply.
Replied to by Proprogrammer04, about 7 years ago:
peanut1001 wrote...
Hello everyone. I am fairly new to Greenfoot and was wondering if anytime in the future Greenfoot will be able to program in 3D spaces rather than just 2D.
There are some 3D engines by now, you just have to search for it. But Greenfoot isn't made for running 3d games, so they are very laggy...
Falling Objects
By FortniteMaster69, with 3 replies.
Last reply by Scorcher, about 7 years ago:
Your Ball code would only need to have the falling speed, not anything else I wrote earlier: <Code Omitted> You would need to add this method to your World code: <Code Omitted> U
Change an images color.
By Notted, with 31 replies.
Last reply by Notted, about 7 years ago:
Nevermind! The problem was that world ref wasn't correct. It didn't point to the right world, which is Space.
Attempting to spawn actors on a timer
By HappyDragon78, with 1 reply.
Replied to by Super_Hippo, about 7 years ago:
"mainEnemy()" is a method, "mainEnemy" is a variable. In your case, you set "mainEnemy" to a "MainEnemy" object in the world. You want to spawn new actors though. So you can remove line 28 and change "mainEnemy()" in line 30 to "new MainEnemy()". You need to add a call to the method from the act method. I suggest to add the "enemySpawn" method into your world subclass instead, though.
I Need Help with a Count Down Timer
By chrishmas, with 10 replies.
Last reply by chrishmas, about 7 years ago:
danpost wrote...
danpost wrote...
Add
showTime();
to the
act
method.
That worked! Thank you so much! :)
190
191
192
193
194
195
196
X