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
NEED SOME URGENT HELP
By imran.ahmad, with 1 reply.
Replied to by danpost, about 6 years ago:
imran.ahmad wrote...
I need to put above image on my program in the beginning. I am able to figure how to start the game. But I am not able to figure out how to open the Help page and exit the game? Can you guys help me out.Need quick response
Add an act method to check and respond to possible keys:
Background colour collision detection help
By -----Sam-----, with 1 reply.
Replied to by danpost, about 6 years ago:
It would probably help to first get the x and y offsets for the direction moving/facing: <Code Omitted>Now you can get the world background and compare the color at (getX()+dx*getImage().getWidth()/2, getY()+dy*getImage().getHeight()/2) to Color.BLACK. The color checking will need to be done for each case of moving direction.
Scroller Displacement Problems
By treykrizek03, with 5 replies.
Last reply by danpost, about 6 years ago:
treykrizek03 wrote...
how I would be able to get the Player to spawn back into the world at the correct checkpoint after falling off of it ... the coordinates of the objects got displaced, so the Player isn't getting set to the correct location.)
You will need to make use of
getScrollX
and
getScrollY
. I guess one way to handle it is to negate the scrolled amount (un-scroll back to initial position), then add the player back in. Another is to subtract the scrolled amounts from the coordinates where you want the player.
Forcing the Mouse
By Brandman73, with 1 reply.
Replied to by danpost, about 6 years ago:
I would presume that the code in
Mouse Trap
by
Bourne
would provide a decent example.
score counter
By JohnBis, with 1 reply.
Replied to by danpost, about 6 years ago:
JohnBis wrote...
Can i create score counter which add score between (480,600) to (520,600) ?
Are those amounts in the hundred thousands or world coordinate pairs? Also, please show attempted codes. It can go a long way in at least showing what you are trying to accomplish.
plz help me
By Roshan123, with 1 reply.
Replied to by danpost, about 6 years ago:
You want to ask about two distinct conditions such that if BOTH are satisfied, then execute some specific code. That is a logical AND operation (if condition (a) AND if condition (b) ...: <Code Omitted>The "
&&
" is the logical AND operator and "
||
" is the logical OR operator.
Is there any other way to get user keyboard input than getKey and isKeyDown?
By mshep, with 2 replies.
Last reply by mshep, about 6 years ago:
Makes sense. Thanks a lot!
I need help, submitting this today for AP CSP!
By lucasstan, with 1 reply.
Replied to by danpost, about 6 years ago:
Apparently, you need a String type argument: <Code Omitted>
Printing an image in another class
By SnowFlurry, with 5 replies.
Last reply by danpost, about 6 years ago:
SnowFlurry wrote...
Thanks! That does make the text print in a visible place, but it still only prints when called from the Text class, calling the textBox() method from the main class still does not make the code print the image... I'm stumped.
Show main class codes with attempt.
shapes
By Roshan123, with 2 replies.
Last reply by Roshan123, about 6 years ago:
ok, thanks for reply
Cannot find method
By neoaspect, with 9 replies.
Last reply by danpost, about 6 years ago:
neoaspect wrote...
Sorry I can't seem to wrap my head around this, I understood the timer part, but not particularly what to put in the 'trackedState' parts
The
<< current state >>
would be the
isTouching
condition. The
<< perform action >>
would be the player losing a life.
Anyone knows what's wrong here?
By MYSTICPHOENIXXX, with 2 replies.
Last reply by MYSTICPHOENIXXX, about 6 years ago:
danpost wrote...
Line 23 in your Bullet class failed because the bullet was removed from from the world (probably due to line 22 or 21). Of course, without the code of the Bullet class being posted, no further assessments can be made nor can further help be provided.
OHHHH, I just saw the problem after reading your comment danpost, thank you so much, you are a really big help!
Anyone know how to prevent freezing on the transferto a second world?
By MYSTICPHOENIXXX, with 3 replies.
Last reply by MYSTICPHOENIXXX, about 6 years ago:
MYSTICPHOENIXXX wrote...
Weeb3.exe wrote...
show code
For what class? The only one that can stop Greenfoot is in the "Skythrust" class.
My music button doesn't stop
By LukaMoon, with 5 replies.
Last reply by LukaMoon, about 6 years ago:
danpost wrote...
LukaMoon wrote...
Where do I put my music?
Put filename as parameter in
BGMusic
constructor call: <Code Omitted>
Thank you so much! Just what I needed
I want to make a bullet be able to affect the lives of both heros in multiplayer mode!
By LukaMoon, with 2 replies.
Last reply by LukaMoon, about 6 years ago:
How would I do that?
122
123
124
125
126
127
128
X