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
Taking damage and disappearing ...
By JDRSkiing, with 13 replies.
Last reply by danpost, over 11 years ago:
Remove the first 'HealthBar ' from the second to last line of your 'prepare' method. You do not want to create a new variable there -- you want to use the one declared on line 13.
How to Stop and reset bg Music
By NoobCoder, with 2 replies.
Last reply by NoobCoder, over 11 years ago:
Oh ok thank you for your help, i manage to do that ^^
Hello,I am the new to Java
By 猎鹰ndnd, with 18 replies.
Last reply by 猎鹰ndnd, over 11 years ago:
OH,my mom and dad told to me that I should take a bath and go to bed.Terriblely it's23o'clock here .and more terrible is that tomorrow isMonday.I don'twant to go to.school.And stay all day there.last and most important, good night
Not updating position?
By ProfessionalNoob, with 12 replies.
Last reply by danpost, over 11 years ago:
How about positioning the cards with something like this: <Code Omitted>You should make sure that you will never have enough cards on the board to reach to right edge of the world or this will cause an infinite loop (the card being placed would not be able to more far enough right to NOT be still touching another; and therefore, the condition of the 'while' loop will never be false to exit the loop).
Run a method from another class?
By h123n, with 13 replies.
Last reply by danpost, over 11 years ago:
According to Wikipedia, I had it backwards; however, it does state that 'brackets' typically refer to different symbols depending on the geographic location of use. The only one it, as a standard, considers a 'brace' IS the curly bracket; and 'bracket' is a general term for all four sets of punctuation: (1) '( )' - round brackets or parentheses; (2) '??' - square brackets (cannot seem to show in this content pane); (3) '{ }' - curly brackets or braces; (4) '< >' - angle brackets or chevrons.
How to get distance to another class?
By EduandErnst, with 9 replies.
Last reply by danpost, over 11 years ago:
EduandErnst wrote...
What do you think about something like this? < Code Omitted >
I think you should use my code above for the character and then, in the class of the moving obstacle, have any player intersecting it move when it moves -- keeping things simple. I am presuming, however, that the obstacle will continue to move normally regardless of any interaction with the player (the obstacle pushes the player around). If you need help with the code for the class of the moving obstacle in this regard, post what movement code you have for it (and anything related to that movement)..
Loading in Actors and If touching Actor
By LamboCreeper, with 3 replies.
Last reply by danpost, over 11 years ago:
There is also an Actor class method 'intersects(Actor)' which you can use if you have a reference to the actor you are checking the intersection of. <Code Omitted>
Crashes every time I shoot the world border
By Salcrainia, with 5 replies.
Last reply by danpost, over 11 years ago:
Salcrainia wrote...
it still annoys me that something that simple is a game breaker :P
Well, I do not think that it is something that can be avoided that easily within the greenfoot framework; and a major part of programming involves taking into account every conceivable situation (making sure that all field and variable values are within proper limits before using them). This type of error messages usually means that this was not accomplished properly or you did not set up a field properly by not assigning a valid value to it to begin with.
Greeps Competition Question
By justdal, with 1 reply.
Replied to by danpost, over 11 years ago:
Rule 5. No long vision. You are allowed to look at the world only at the immediate location of the Greep. Greeps are almost blind, and cannot look any further. I believe what you have above constitutes looking at the immediate location and would therefore be allowed.
Add to counter when object gets removed
By GuilhermeGomes, with 2 replies.
Last reply by GuilhermeGomes, over 11 years ago:
I earlier forgot to write this <Code Omitted>. So how do i do it? I followed Joy of Code #28 guide so i tried to do the same has michael EDIT: IT WORKS NOW :D!!! only had to change to this <Code Omitted> thank you for your help!
Character animation in a scrolling World help!
By OwlyL, with 8 replies.
Last reply by OwlyL, over 11 years ago:
Thanks for your advices. I fixed the Bug per seperating the animation from scrolling. was more easier than I thought!
Take hp
By 0gener, with 2 replies.
Last reply by 0gener, over 11 years ago:
Thank you very much for the explanation and for the code, it´s now working.
Need help with draw features/dimensions
By shooterbooth, with 6 replies.
Last reply by shooterbooth, over 11 years ago:
Here's the code I ended up using in case anyone in the future ever comes across this post looking for a soccer field. It looks perfect and is for a world of 600 width and 400 height.
How do you get a bullet to shoot left help plz
By Linniah, with 3 replies.
Last reply by Linniah, over 11 years ago:
It work!!! Ty so much
How can I make a background out of 3 separate images?
By decadence18, with 1 reply.
Replied to by danpost, over 11 years ago:
The following constructor will draw three images onto the background image:
586
587
588
589
590
591
592
X