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
How to memorize the last key pressed?
By AnJoMorto, with 2 replies.
Last reply by AnJoMorto, over 5 years ago:
danpost wrote...
Best would be to keep gifs in fields and have a specific field for the active gif. Something along these lines: << Code Omitted >>
You made some mistakes it seems, but I corrected it and it works perfectly! Thank you so much @danpost . You've been the person behind my whole project since you answer all possible questions I find in this platform. Thank you again. And here's the corrected code for those who need it:
Images not displayed
By marv47, with 2 replies.
Last reply by danpost, over 5 years ago:
marv47 wrote...
When I rightclick on my class to set an image (from the greenfoot preset images) e.g. as the background the image is not displayed I tried this with other classes and images aswell but none of them are displayed. <Image Omitted>
The actors' images should change when you "
Reset
" the scenario.
My Characters wont jump for some reason
By MrSkyPanda, with 1 reply.
Replied to by RcCookie, over 5 years ago:
You aren’t calling the jump() method, only the checkJump() method. You generally don’t need the gravity variable. If you want to be able to adjust the gravity strength you need to adjust how much vSpeed is changed when the object is falling
Mouse click hold ?
By Paul12345, with 1 reply.
Replied to by RcCookie, over 5 years ago:
You need to track the mouse‘s state: <Code Omitted>If you want pressed only to be true if the mouse was clicked onto a specific actor, replace the null in line 4 with the specific actor, BUT NOT in line 5! <Code Omitted>
Explanation in need
By Roshan123, with 10 replies.
Last reply by RcCookie, over 5 years ago:
No, that are just example methods that show what should be done in a certain case. These methods are: getSpeedX() getSpeedY() setSpeed() paintToColor() setColors() They just indicate what could be implemented right there
hello world
By ronald, with 4 replies.
Last reply by ronald, over 5 years ago:
thanks for the code I understand better by using a private access for the buttons which allows to differentiate them, I did not think about it thank you
Color
By Roshan123, with 5 replies.
Last reply by danpost, over 5 years ago:
Roshan123 wrote...
Its full of errors
Not if implemented properly.
How to create a variable on Initialization
By FranzVnH, with 3 replies.
Last reply by danpost, over 5 years ago:
FranzVnH wrote...
<< Code Omitted >> This is the code of one actor in particular, but the value will consistently change because X and Y will constantly change.
Where did you put that? Show entire class codes please.
does anyone know how to make a hitbox?
By MrSkyPanda, with 3 replies.
Last reply by MrSkyPanda, over 5 years ago:
oh! that could work. I will see if i can figure out how to code that.
My Platforms dont work with My gravity
By MrSkyPanda, with 18 replies.
Last reply by danpost, over 5 years ago:
MrSkyPanda wrote...
ok so how do i fix it?
Again refer to my demo. If you have behavioral issues with the code, then show that code and ask questions. Or, you can upload the scenario with the unwanted behavior (or a sample exhibiting that behavior with the same problem code).
Please Help: My Circles won't become Transparent
By justwooki, with 1 reply.
Replied to by MrSkyPanda, over 5 years ago:
is your oval an actor?
Adding only one actor
By NikoAa, with 1 reply.
Replied to by danpost, over 5 years ago:
NikoAa wrote...
I'm making a game where i want to add another actor every time the score is divisible 5. << Code Omitted >>
Move line 7 to after line 12. This will limit the score divisibility check to only when the score changes.
Collision
By Roshan123, with 21 replies.
Last reply by danpost, over 5 years ago:
Roshan123 wrote...
I noticed that u wrote 90* If i m not wrong then the algorithms are only for only 90° rotation and not for all degrees of rotation
I guess you are looking for something more along these lines:
ZIG-ZAG MOVEMENT OF CHESS PIECES
By 1234567890, with 1 reply.
Replied to by danpost, over 5 years ago:
Answers to hints: 1) every other move; 2) same as (1), but not on same moves; 3) always; 4) when at (right) edge (or after 7 moves, if starting at left edge). If you flip the
boolean
value every act, it should not be hard to move in a zigzag across the board using an
if
conditioned on the
boolean
.
My Platforms dont work with My gravity
By MrSkyPanda, with no replies.
it keeps going right through the platform. and everytime i run it, it also slowly moves to the left for some reason. How Do i fix it?<Code Omitted>
107
108
109
110
111
112
113
X