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
creation of text images causing lag
By ErasedBlade, with 7 replies.
Last reply by Zamoht, over 7 years ago:
As mentioned by others you should avoid removing and adding objects. However I believe the slowdown happens because you create a new GreenfootImage that is quite large. Two ways you can improve this, if possible make the image smaller than 1000x100, and instead of creating a new image every time, you could store the image in an instance field and update it as needed.
How to add timer?
By hd3377, with 4 replies.
Last reply by Super_Hippo, over 7 years ago:
For an easy start, import the Counter class. Try to follow its description and come back with questions if you have any.
I need help with a beginner memory game, I can't get my card to match
By samNY, with 2 replies.
Last reply by Super_Hippo, over 7 years ago:
I would probably control it from the world and not from the cards. If the cards should do it on their own, you can have one static field which saves the card which was clicked on first. So when you click a second card, you can decide if this card's image equals the static one and after this check, set the static card variable back to null.
Game lags with bigger world sizes
By Tim1Blau, with 5 replies.
Last reply by Tim1Blau, over 7 years ago:
Thanks for your answer, I have sent the project files to the given adress. I hope you can help me with my problem!
How do I make my character only move Left or Right?
By secretbackupboss, with 3 replies.
Last reply by Super_Hippo, over 7 years ago:
This line is doing nothing at all: <Code Omitted>
Plagiarism
By jackreacher659, with no replies.
Will it detect plagiarism if i paste my code in here and if there is the same code in my assignment or report ??
Overlapping Of Pictures (Gif)
By Karsten, with 1 reply.
Replied to by danpost, over 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, over 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, over 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, over 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, over 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, over 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, over 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, over 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, over 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.
190
191
192
193
194
195
196
X