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
What is happening right now?
Latest Scenarios
Update: First S...
DinoPig
DuskMobile
Dusk
Maze Game Perfo...
My Fish
more
Popular Scenarios
RaceCars
Hungry Dogs - P...
Wizard Quest
Chicken Defender
Sandbox Tower D...
Sans Pong
more
Popular Users
more
Popular Collections
Optical Illusions
Reusable actors...
Scenario showcase
Demos by danpost
more
Update: Update: First Step
By Borislove - about 5 hours ago
Update: DinoPig
By arvinsadeli - about 20 hours ago
Update fixing background sound bug
reply to How to reset a World while the Program is running?
By Bankspeers - about 24 hours ago
Thank you, now it works
Update: DuskMobile
By Jarvis1027 - 1 day ago
Music-based platformer
Update: Dusk
By Jarvis1027 - 1 day ago
Music-based platformer
Update: Maze Game Performance Test
By MrCohen - 2 days ago
Update: My Fish
By Borislove - 2 days ago
add
-collision world
New Scenario: Final Project
By Norman - 2 days ago
New Scenario: Kunio Saito's crab game
By KunioSaito - 2 days ago
Update: TOILET GIBBON
By Username1234 - 2 days ago
Made game easier
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.
Update: rui adventure
By xcv - 2 days ago
X