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
How do I turn an actor without rotating their image?
By bintin125, with 1 reply.
Replied to by danpost, over 10 years ago:
Maintain a zero rotation by saving the direction of movement in a field: <Code Omitted>
Editing .jar files in greenfoot
By bintin125, with 2 replies.
Last reply by bintin125, over 10 years ago:
OK. I'll try that out. Thanks!
World Reset
By Luc_Stoffer, with 1 reply.
Replied to by danpost, over 10 years ago:
Luc_Stoffer wrote...
When I lose my game, a GameOver-Screen appears but if I then press the "Reset Button" and try to run the program again, immediatelly the "GameOver-Screen" appears again... Has anyone a clue where the fault could be?)
You are probably using static fields where you shouldn't -- or you are not initializing their values in your initial world where you should.
How to continue Counter score to different worlds and make a leaderboard score when win or lose?
By Sir_brandon_, with 18 replies.
Last reply by Sir_brandon_, over 10 years ago:
just to make sure everything is correct heres my world
How do I draw a rectangle whitout fill?
By GreenBat, with 1 reply.
Replied to by danpost, over 10 years ago:
The first two parameters of the 'drawRect' method are the location coordinates that the rectangle is to start from on the image it will be drawn on. It is the location where the top-left corner of the rectangle will be. If you place the top-left corner of a rectangle below and to the right of the image, none of the rectangle will be drawn on the image itself. Btw, a new GreenfootImage will have a default drawing color of black; so the last line is not needed: <Code Omitted>This line starts the rectangle at the top-left corner of the created image and gives the
Trouble with getX and getY
By StoveAteMe, with 1 reply.
Replied to by danpost, over 10 years ago:
StoveAteMe wrote...
What I want is when every time I press W, I want to create an object (a missile) from the location of my current movable actor (Savior). I have this much so far but I can't seem to understand what I am doing incorrect. This code is in my actor class "Savior", if that helps at all.
Yes -- knowing the code is in your Savior class help a bunch. You are trying to use the 'getX' and 'getY' methods on the class itself. The class is the script that you write -- not the actor(s) that are created from the class. The class has no location in your world -- the objects create
ScreenReadjusts
By laxmonkey8, with 1 reply.
Replied to by danpost, over 10 years ago:
You probably used the 'clear' method on the background image. The background should remain opaque. If you do 'clear' it, make sure you 'fill' it again with a non-transparent image or color.
using labels and counter
By khoalabear, with 4 replies.
Last reply by danpost, over 10 years ago:
khoalabear wrote...
Just a graphical problem. When it counts up from 0 to 1, the label seems to get blurred. Any reason why?
I cannot say why the image is blurred in such a way. I, for one thing, prefer not to use the 'drawString' method as the image is already set in size and if the new string drawn on it is larger, it is possible to lose the last part of the drawn string off the edge of the image. I prefer to create a text image (using the GreenfootImage constructor that requires the text to be drawn) and then use the 'drawImage' method if needed (the size of the two images ca
How to go after one target
By Bassusour, with 28 replies.
Last reply by danpost, over 10 years ago:
Bassusour wrote...
Now the only problem is the game crashing (The same error codes as I mentioned from my last post) when a missile is in the air, and both players are gone.
Again, you need to post the error trace. Do what I mentioned in my last post.
Stop backgroundmusic when game is over
By Bassusour, with 3 replies.
Last reply by danpost, over 10 years ago:
Where did that line 5 come from? That is nothing like the way it started (up to where the first period was located).
My Greenfoot doesnt work
By Leon, with 1 reply.
Replied to by danpost, over 10 years ago:
Try 'Ctrl-B' and clicking the 'Terminate' button. If you can modify your initial World class so that it will not properly compile (maybe add an extra closing squiggly bracket at the end of the class) -- do so, and try the 'Terminate' button again.
generate a random 4-character secret
By dhaval1704, with 2 replies.
Last reply by danpost, over 10 years ago:
Now if you wanted to create a four character secret using the entire alphabet, you could remove the parameter from the method and adjust the name of the method to call it with 'getRandomAlphaChar()' and then the method could be this: <Code Omitted>The 26 is the number of characters in the alphabet and the 65 is the Unicode value pointing to the first one -- A.
help with the if else please
By divinity, with 2 replies.
Last reply by divinity, over 10 years ago:
hi super_Hippo I got it to work. thank you oh soooooooooo much for pointing that out to me. thanks for the help
removing object using size?
By khoalabear, with 39 replies.
Last reply by khoalabear, over 10 years ago:
YES! It works finally! Thanks so much for your help. You've been amazing. Also thanks to Danpost for your help too ^.^
can someone please tell me how to fix these errors? i have been at this for days. i cannot fix anything
By georgiatl666, with 1 reply.
Replied to by Super_Hippo, over 10 years ago:
I think this is the most confusing code I have ever seen. Did you write this code on your own? I already see some mistakes, but I think it is not a good idea to correct every mistake here. Just correct the errors step by step. Start with changing every method to this: <Code Omitted> Then your code will actually be readable.
478
479
480
481
482
483
484
X