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
Please!!!! Help im stuck with this
By RICHJAMA, with 6 replies.
Last reply by RICHJAMA, almost 11 years ago:
oky thank you so much im new to green foot so my methods be out of whack. i have changed the 'if' statements and also the '17' and it helped tremendously.
How Do You Restart A Level When You Die
By BashBashAttack, with 3 replies.
Last reply by danpost, almost 11 years ago:
You must be adding your actors into the world manually. They will not reappear when you reset unless you 'Save the World' after adding them. You cannot 'Save the World' once any act cycles have been executed; so, do this immediately after you have placed all your actors where you want them.
How to access a variable from another class.
By Jeb_CC, with 9 replies.
Last reply by danpost, almost 11 years ago:
If you are going to assign 'card2' with an object, then there are several ways to go about it. One is passing the Card2 object to the Card constructor; one is finding the Card2 object when the Card object is placed into the world; and, another is using a method call to set a Card2 object to the field. The first and third ways are quite similar, in that they use parameters to the methods to pass the Card2 object to the "new" Card object. The second way, uses brute force to find the Card2 object in the world to get the object to be referenced in the field. Summary of the first and third ways
Help Displaying a Message and then Removing it
By shooterbooth, with 3 replies.
Last reply by danpost, almost 11 years ago:
An easier way for the temporary message is to subclass the Message class with a TempMessage class with the timer int field and an act method to run the timer and remove itself when the timer is exhausted. That would keep the code cleaner in the class above and well as clean timer code. <Code Omitted>Then, to adjust the code Super_Hippo
Removing Objects
By Tylon619, with 1 reply.
Replied to by danpost, almost 11 years ago:
You referred to the action "remove objects" and the location "bottom of my screen". For the first, you need to find the correct method (which should not be too difficult; although you may want to ask yourself "what am I trying to remove the object from?"). For the second, ask yourself "how do I know when a location is at the bottom edge of the screen?". The answers are (1) the world; and (2) when the y-coordinate of the location is equal to one less than the height of the world. Hopefully, that will lead you along the correct path to the solution.
getWorld() == ??
By 0gener, with 2 replies.
Last reply by 0gener, almost 11 years ago:
Thank you very much, it worked :D
I have a car game i want to create or get a background sound
By david12, with 2 replies.
Last reply by david12, almost 11 years ago:
thanks danpost
Help with Score Milestone
By GabrahamCAPS, with 8 replies.
Last reply by GabrahamCAPS, almost 11 years ago:
Super_Hippo wrote...
<Code Omitted>
Thank you very much.
double object at world edge
By Jeph, with 5 replies.
Last reply by danpost, almost 11 years ago:
You can limit the number of balls in the world by adding an if condition to the spawning of new balls (if the number of balls in the world is less than 4, or 5). As far as there being another way to add new balls into the world when one reaches a world edge, not really. @LordLuhar * the int field 'i' would be unique to each ball, so each ball will then know how many other balls that it has spawned; * 'Public' in line 3 should be 'public', starting with a lowercase 'p' (same on line 7); * 'class' in line 7 should be 'void' (there is no value returned from the method); * method names s
How to bring text image to the front
By Twentyonestreet, with 6 replies.
Last reply by Twentyonestreet, almost 11 years ago:
Super_Hippo, thank you!
Key controll
By EduandErnst, with 2 replies.
Last reply by davmac, almost 11 years ago:
One alternative (though not necessarily the simplest) is to move the check for both conditions to the top: <Code Omitted> Better would be to split the left/right and jump handling, essentially so that "left"/"right" both move and change the direction the player is facing, and "up" jumps in the direction they are facing.
need help figuring out how to move my actor at a get random speed
By kyles247, with 11 replies.
Last reply by kyles247, almost 11 years ago:
Ok thanks i will try to also add to this code. Thanks for all the help
Counters
By sophiaking, with 1 reply.
Replied to by fejfo, almost 11 years ago:
I don't understand what u want please show some code
setImage doesn't work
By 2leftfeet, with 2 replies.
Last reply by 2leftfeet, almost 11 years ago:
dan the man. i had a 2nd occurrence in the world like you said. fixed!
health help!
By Moho, with 14 replies.
Last reply by danpost, almost 11 years ago:
Moho wrote...
i had eat and i also tried getWorld().removeObject(Heart.class); but it that one doesnt work...
Like I said before, the 'eat' method is not going to do what you want because it looks for intersectors , not just objects in the world. And, of course 'getWorld().removeObject(Heart.class)' will not work because the 'removeObject' method requires an Actor object, not a class.
i also tried getWorld().Heart.removeSelf(); but that doesnt work either and yes it is currently set as eat
I do not know why you tried that! Looks to me like you are throwing things to
591
592
593
594
595
596
597
X