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
Greenfoot Visual Bug?
By test123, with 1 reply.
Replied to by davmac, over 9 years ago:
Most likely this is a problem with your graphics driver. Try upgrading to the latest driver.
Shoot Towards Hero
By rkr, with 13 replies.
Last reply by Super_Hippo, over 9 years ago:
Ah ok. In this case, you can save a reference to the shooting enemy in the bullet class and when it hits, the enemy can get invinsible: <Code Omitted>
Change image problem
By rkr, with 4 replies.
Last reply by danpost, over 9 years ago:
Are you sure the imgs array has the exact same name that is being asked for -- "host.png"? (case-sensitivity question) You could try just setting the image right there using: <Code Omitted>If that works, then the problem is somehow related to the array.
User Input - Storage
By JulianYoung, with 99 replies.
Last reply by JulianYoung, over 9 years ago:
YAY! Thanks for help!!
Levels
By jacquelinereilly, with 3 replies.
Last reply by jacquelinereilly, over 9 years ago:
thank you!
bouncing realistically of edges
By Kieranwilko98, with 1 reply.
Replied to by danpost, over 9 years ago:
It might be easiest to add border actors around the grass. They can all be of the same class type with the vertical ones rotated. Then, when encountered by the ball, you can determine how to adjust the position and direction of the ball by the rotation of the border and the original direction of movement of the ball.
How do you make an image smaller and make the "hit box" transparent
By new113, with 10 replies.
Last reply by Nosson1459, over 9 years ago:
new113 wrote...
Also when I used that code (Nosson1459)were do you put the size of the actor?
That's what I'm asking you. I never knew there was a thing of setting actor sizes. What I was saying was that the actor size is it's image, so your actor is 400 x 400 pixels big "The size of my image is 400x400 pixels.". My code should be put in the place that you want to change the size or transparency of the image. If you want to do this in the beginning then put the code in the class constructor. You can put anywhere in the middle of your code to change the size of the image/actor in the mi
I need help ;-;
By CinnamonCedar, with 2 replies.
Last reply by Nosson1459, over 9 years ago:
On the side bar in Greenfoot the Play subclass of World should have red lines going through it then when you open the editor, line 43 should have squiggly red lines under it (for the reason discussed above), if you hover the mouse over the words in that line of code a black box should appear near the mouse saying something like "cannot find symbol- variable alienCount" meaning that the variable "alienCount" doesn't exist (it means what it says and says what it means so just be reading it you should know where to look for the problem making it much easier for you to figure out then anyone here
Text
By Nosson1459, with 2 replies.
Last reply by Nosson1459, over 9 years ago:
Thanks.
danpost wrote...
You could test this out:
It's true that all I'm doing here is "testing".
definitions
By davemib123, with 10 replies.
Last reply by davemib123, over 9 years ago:
great. now i get it :)
Image changing problems
By wolfyze, with 2 replies.
Last reply by wolfyze, over 9 years ago:
Oh, it works now. I forgot to make the quest window add only one text ;_; Thank you
Passing an Actors location to the next World
By Paswalt, with 7 replies.
Last reply by danpost, over 9 years ago:
I did create the above as if the code was in the class of the player. But, if instead of 'this' on line 4, you reference your player object in the first World, you should be okay coding it in the first World. <Code Omitted>
Code for a counter
By louiseagbayani, with 1 reply.
Replied to by danpost, over 9 years ago:
louiseagbayani wrote...
How can I make my counter increase by 1 once it collects a certain object?
Will need to see codes; first, all codes in your World subclass that deal with the counter and the object that collects the objects; then, the code for the Actor subclass of the one that collects the objects.
how can I make my "Game Over" text be seen only when it is needed (at the end)
Create a public void method in your game World subclass that performs the actions needed when the game is already determined over. Two sets of conditions are required for game over. If w
Adding "1" to end of filename
By arianne_navarra, with 13 replies.
Last reply by danpost, over 9 years ago:
Your code suggests that you have 4 images: 'battleship0.png', 'battleship1.png', 'battleship2.png' and 'battleship3.png'. Since you only have one, namely 'battleship0.png' (currently), then I do not see what the purpose of the 'animateFlame' method or the 'frame' field are for.
Interaction MyWorld and actors ?
By Lollipoke, with 1 reply.
Replied to by danpost, over 9 years ago:
Lollipoke wrote...
But when I try to call it like "this.getWorld().nextPiece()", Greenfoot doesn't agree
It is not that Greenfoot does not agree -- the java compiler does not agree. The method 'nextPiece' is not in the World class -- it is in the MyWorld class. The method 'getWorld' returns a World object. It may be an instance of MyWorld, but the compiler does not know that. You can confirm to the compiler that the world will be an instance of MyWorld through typecasting -- a way of telling the compiler what type of World subclass it actually is. Try this: ((MyWorld)this.ge
410
411
412
413
414
415
416
X