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
non-static variable : health
By pleasehelpme, with 1 reply.
Replied to by davmac, about 11 years ago:
Please
read this advice
, especially part 4.
Moving platform
By Miggyxd, with 1 reply.
Replied to by danpost, about 11 years ago:
We cannot help without knowing what code you are using. Please post the class code of the moving platform.
Help with variable
By Elexios, with 1 reply.
Replied to by danpost, about 11 years ago:
You are probably declaring the variable within a method or constructor. Declare it outside any method or constructor to have the actor retain its value.
Flak Cannon
By Zinks2, with 1 reply.
Replied to by Zinks2, about 11 years ago:
Don't worry! I've fixed it- I had set my shotTimer at the beginning so the next command wasn't activated (if shotTimer==0).
Help on my Ammo Counter~
By Erio, with 24 replies.
Last reply by Erio, about 11 years ago:
oh, I wasn't really sure on how to use the getRandomNumber at first. Thanks for explaining! :) I'm almost done with my game. Thanks guys :)
Help With A Point Counter
By Elexios, with 1 reply.
Replied to by danpost, about 11 years ago:
Please refer to my
Value Display Tutorial
scenario.
Moving Platform
By Miggyxd, with no replies.
<Code Omitted>
incompatible types int cannot be converted to boolean
By Elexios, with 3 replies.
Last reply by Elexios, about 11 years ago:
omg you guys are the best!!!
Can An Actor Use Add Object
By Elexios, with 1 reply.
Replied to by danpost, about 11 years ago:
You asked if an Actor can use addObject. You really mean one of two things: (1) can an Actor object add a new object of a different type into the world; or, (2) can the addObject method be used in an Actor subclass; Answers: (1) yes, any Actor object of any type, new or otherwise, can be added into the world by any Actor object that is either in the world or that contains, or has access to, a reference to the world the object is to be added into; an Actor object already in the world can use 'getWorld' to get the reference and the line would look like this:
Object Constructor
By Vellyxenya, with 10 replies.
Last reply by Vellyxenya, about 11 years ago:
Ok, thank you very much :)
How do you make the crab give a certain sound after it turns more than 18 degrees?? It already moves when the left/right keys are pressed. What code do I add? PLEASE HELP!!!
By Mack, with 1 reply.
Replied to by danpost, about 11 years ago:
Mack wrote...
How do you make the crab give a certain sound after it turns more than 18 degrees?? It already moves when the left/right keys are pressed. What code do I add?
Please be more specific. Eighteen degrees is specific enough; however, from what, how often -- every 18 degrees of turning? Might be a good idea to list here the rotational values at which you want the sound to play or if it is the sum of rotational change of both left and right turning that you want for playing the sound. Either way, it is not to difficult to code. The easier one to code is for every 18 degree
Moving worms "up" or "down" on keyboard
By Mack, with 2 replies.
Last reply by Mack, about 11 years ago:
Thank you so much Letin!!!! I have another question..... Would you also know how to make the crab play a sound when he turns more than 18 degrees??
Need Help with Greenfoot Scenario
By letin, with 2 replies.
Last reply by letin, about 11 years ago:
Thank you!
Having a Lobster Eat Every Other Crab
By letin, with 2 replies.
Last reply by letin, about 11 years ago:
Thank you!
Help me with my program please
By steezyjapaneezy, with 3 replies.
Last reply by Mack, about 11 years ago:
Steezyjapaneezy I posted the same question on here about lobsters eating every other crab randomly and I got some help! Try this code, it should work perfectly! // instance field private int touchCounter; // the 'lookForCrab' method public void lookForCrab() { // check for change in touching state if (isTouching(Crab.class) == (touchCounter % 2 == 0)) { // track state touchCounter = (touchCounter+1) % 4; // check for second touch if (touchCounter == 3) { removeTouching(Crab.class); Greenfoot.p
537
538
539
540
541
542
543
X