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
Check if a series of keys was pressed
By LimeLava, with 3 replies.
Last reply by danpost, almost 10 years ago:
LimeLava wrote...
What I did was create a int variable for the keys and then added 1 to it every time someone hit the key
This is the idea behind the 'keyIndex' field I had given above. However, it should only be incremented when the next key in the sequence is detected:
i want my bullet to move in the direction i was facing at the time i shoot it
By nathen, with 1 reply.
Replied to by Super_Hippo, almost 10 years ago:
In what class is this code? I am bit confused because you use the 'bullet' image there and you control it with the arrow keys. Usually it would look like this: <Code Omitted>
Random image display
By ParkoPlays, with 4 replies.
Last reply by danpost, almost 10 years ago:
ParkoPlays wrote...
I ended up finding a solution on someone elses post before this one got moderated. ,,, < Code Omitted >
The code shown in your last post can be simplified to: <Code Omitted>There was one slight adjustment I made. You do not appear to have a "0.png" file, which would get a FileNotFoundException if it tried to open that one. The range of values here is (1 ... 721).
Loop Help
By Wasupmacuz, with 2 replies.
Last reply by Wasupmacuz, almost 10 years ago:
Super_Hippo wrote...
I don't think that you want to use a while loop there. Just changing it to 'if' won't work either though. What exactly are you trying to achieve with line 3? Do you want it to turn after a random amount of time? Maybe like this?
how to create an object with a different score?
By zaenal97, with 1 reply.
Replied to by Super_Hippo, almost 10 years ago:
<Code Omitted> Or <Code Omitted>
Need Help
By bob123, with 1 reply.
Replied to by Super_Hippo, almost 10 years ago:
Check out
this discussion ← link
.
Problem Open in Greenfoot NOT APPEARS
By AmazingCreations, with 1 reply.
Replied to by Super_Hippo, almost 10 years ago:
In the 'Flappy Bird REMAKE' you uploaded, there is the green 'Open in Greenfoot' button. You can toggle it through the 'publish source code' box when exporting.
Why doesn't this work? Loop error.
By Astralman, with 3 replies.
Last reply by Nosson1459, almost 10 years ago:
It's an infinite loop. i=i*i is saying i=1*1 which is 1 so 'i' will never be >15.
Need help with a character change
By BonJunzi, with 6 replies.
Last reply by Nosson1459, almost 10 years ago:
BonJunzi wrote...
<Code Omitted>That is everything in first class
BonJunzi wrote...
<Code Omitted>this is everything in the class it is turning into
If that is all you have in your classes then you will for sure have syntax errors for:
Not importing the necessary imports for the used methods
Not having a class method
Not having an act method
Using undefined variables
you should
danpost wrote...
show the complete class code
(not just methods). If you are on windows then: 1) open your source code 2) press
problem with array need help
By jrod159, with 18 replies.
Last reply by Super_Hippo, almost 10 years ago:
You could try this: <Code Omitted> Then you need to use 'addObject(new Invader(number)...' with 'number' being 0 for the first row, 1 for the second and 2 for the third.
Help with Loops and arrays inside of World
By Snans, with 1 reply.
Replied to by Tritos, almost 10 years ago:
<Code Omitted>This would be a very simple example for doing that. You could alse make the position the fish starts at change like so(for example) <Code Omitted>
Object Interaction
By georgette, with 4 replies.
Last reply by georgette, almost 10 years ago:
You are the best danpost.. it works! Thank you!!
KnockBack
By rkr, with 7 replies.
Last reply by Nosson1459, almost 10 years ago:
rkr wrote...
nvm dont tell me i have an idea
What's wrong with telling you ( ; ) ) (you could just not look if you really want)?
This is a warning that you shouldn't look further cause you don't want me to tell you (unless you want an idea).
You can use the getOneObjectAtOffset(int dx, int dy, java.lang.Class<?> cls) found
here
.
how to do not walk through the wall!
By Roselina, with 5 replies.
Last reply by Nosson1459, almost 10 years ago:
rkr wrote...
true i didnt see the "maze" part lol
This discussion is from 2 days ago anyway.
explosion code
By rkr, with 8 replies.
Last reply by Nosson1459, almost 10 years ago:
YAY! I'm trying out the "Yay" tag (good time and place to try it).
419
420
421
422
423
424
425
X