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
Game Over when it down
By KKobra, with 1 reply.
Replied to by danpost, over 8 years ago:
KKobra wrote...
How can you make a game screen about when Y character to greater than 399, what is it when it's coming off the screen? I was trying this way << Code Omitted >>
Nothing seems wrong with the code given. Are you calling
playerDie
from the
act
method of the class?
Scrolling world
By AAA355, with 3 replies.
Last reply by danpost, over 8 years ago:
AAA355 wrote...
thanks heaps, i followed the tutorial and there are a few errors in the code but i copied it exactly, << Code Omitted >> there is an error on line 25 saying cannot find symbol and an error on line 60 also saying cannot find symbol..
Well, not exactly. Also, the errors should be on lines 27 and 62. Line 27 should have a space between "new" and "Scroller" and line 14 should be: <Code Omitted>since you want
scroller
to refer to a
Scroller
object. Then, since your Lizard object was already added to the world before calling the prepar
How to make a sound plays only once even if the key is kept pressed?
By TomazVDSN, with 2 replies.
Last reply by TomazVDSN, over 8 years ago:
danpost, it is impressive, Thank you.
Controlling specific objects help
By maboidanpost, with 1 reply.
Replied to by danpost, over 8 years ago:
maboidanpost wrote...
<< Code Omitted >> Works when base is 2 but not when base is 1
You will need to show the code for the class from which the
rife
method is called.
Game stops when my lazer hits an enemy.
By Daanfaverey, with 1 reply.
Replied to by danpost, over 8 years ago:
Daanfaverey wrote...
I'm using greenfoot for a schoolproject. That's the reason why i'm asking this much questions :). My sonic can shoot lazers. First when my sonic did shoot lazers the lazers would get stuck at the right edge of the world. But if they hit my enemy1 (in the game called 'Vijand1') they would disappear. Now i found a way to remove the lazers that got stuck on the right side of the map. But when a lazer hits my enemy1 (Vijand1) the game stops. How do I fix this? << Code Omitted >>
In the
sonic
class
act
method, move the
return
statement (in the last
Changing pictures when moving other directions.
By Daanfaverey, with 1 reply.
Replied to by danpost, over 8 years ago:
Daanfaverey wrote...
Hello I'm making a sonic styled game. My sonic can move 4 different directions which are up, down, left and right. Using the arrows you can move sonic around. Now i only have a picture for sonic running from left to right. I want to have 4 different pictures, one picture for each direction. How to do this? << Code Omitted >>
You can mirror the image you have to get the left running sonic; however, you will still be out of luck with the up and down images (unless you do not mind rotating the image you have (causing left to be upside down).
Limit Rotation
By Applez, with 4 replies.
Last reply by Applez, over 8 years ago:
Well dan's code worked! thank you! I guess theres no point explaining it now...
NullPointerException error even precautionary if statement and multiple instances of class in the world. (ma boi danpost help me out)
By maboidanpost, with 2 replies.
Last reply by danpost, over 8 years ago:
You did not check for
getWorld
not be return
null
first like you did on line 58.
getRandomNumber and <<Image>>.equals<<Image)\>>
By Lavenger, with 3 replies.
Last reply by danpost, over 8 years ago:
E is just the type of
e
lement the list is declared to hold.
Bomberman
By krys_wr, with 2 replies.
Last reply by krys_wr, over 8 years ago:
It worked thank you
Changing worlds
By Lavenger, with 59 replies.
Last reply by Lavenger, over 8 years ago:
oh I see... didn't even see that while I was checking
changing levels?
By HecticKiwi, with 1 reply.
Replied to by danpost, over 8 years ago:
It is obvious why line 52 in the LeveOne world does not work. You pass 9 for the value (from line 24); so, it is not 2. It is also obvious why line 32 in the
Player
class does not work. You declare the variable at line 26 with a value of zero and it is incremented once at line 31; so, its value is not 2 there either. You were questioning if the code should actually go there -- I think not. You also mentioned that no fruit should be left to change levels. Checking for no fruit in the world to change worlds sounds like something that should be done in the world. Although not pr
About non-center Rotation
By kodokulo, with 19 replies.
Last reply by kodokulo, over 8 years ago:
ok thanks
Greenfoot.ask to int in constructor
By TheGoldenProof, with 2 replies.
Last reply by TheGoldenProof, over 8 years ago:
danpost wrote...
You are probably creating the calculator during project reset (when world is first instantiated and before the scenario is in a running state). Try to avoid using
ask
at that time.
Thanks, I figured it out. I changed it to check whether or not a value had been entered or not in the act.
Having Trouble with Space, Counter, and Explosion
By razornale, with 4 replies.
Last reply by danpost, over 8 years ago:
razornale wrote...
I'm still having a error message on line 44 GreenfootImage(); is coming back with an error message of GreenfootImage() has private access in greenfoot.GreenfootImage
Firstly, there is no
GreenfootImage
constructor that has zero parameters. Secondly, you are not yet wanting to create an image -- that is done within the following
for
loop. You may, however, want to declare the variable to hold a GreenfootImage at that time (although that is not mandatory as you can declare it inside the loop where it would be declared each iteration of the loop). You ca
269
270
271
272
273
274
275
X