This site requires JavaScript, please enable it in your browser!
Greenfoot back

What is happening right now?

Bankspeers

reply to How to reset a World while the Program is running?

By Bankspeers - about 24 hours ago
Thank you, now it works
danpost

reply to How to detect if all objects are gone

By danpost - 2 days ago
Psg wrote...
hey, dan I need your help. I have a problem. I believe this if statement is working, but reading the wrong value of the integer rotate. What should i do
First, you should understand that the rotation is already being held in the Actor class, meaning you do not need to declare another field for it. You could use something like the following: <Code Omitted> It is not really clear by your code as to exactly what you are trying to achieve with the turn methods Obviously, you want the crab to turn sharp at an edge, which can simply be accomplished with: <Code Omitted>The turnCrab method is totally unclear. There is no code shown where the value of one is turned back to false. And line 15 seems a bit strange as it appears the turn will only occur when the rotation is not horizontal (exactly left or right) and the turn must only occur along a distinct diagonal line going 45 degrees downward starting just below the top-left corner of the scenario window. I doubt very much that this is what you were going for.