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
Boolean
By Joorror, with 3 replies.
Last reply by Gevater_Tod4711, over 13 years ago:
to just check you need to use the method getOneObjectAtOffset. I think the use of a parameter would be good in this case:
closing an image
By Abdi, with 7 replies.
Last reply by danpost, over 13 years ago:
I am not too sure that you want it to be a subclass of mainmenu or just a subclass of Actor. Anyway, to add an actor into the world, use the World class method 'addObject'.
What coding is required to stop the player entering through the walls?
By Blakehammond, with 6 replies.
Last reply by danpost, over 13 years ago:
If your walls are at least 4 pixels wide then you should be able to detect when you came upon one. After the 'checkKeys' call in the act method, add a 'checkWalls' method. Create the new 'checkWalls' method checking for intersecting walls (one check for each type of wall). If either wall is present, move the character back to the location it started at. You will have to add fields to hold the initial location and set them at the beginning of the act method.
Problem with getWidth()
By sopi, with 12 replies.
Last reply by davmac, over 13 years ago:
But maybe someone could explain me why I always get a error by using the getWidth method.
getWidth used to be an Actor method in earlier versions of Greenfoot, but in recent versions it is not. You have to call getImage().getWidth() (or equivalent) instead.
Upgrade screen between rounds
By GreenGoo, with 1 reply.
Replied to by danpost, over 13 years ago:
Since each world will know which world to proceed to next (after the between screen is shown), you would want to create the new game world before calling the between screen world; pass it to the between screen world so it can go to that world when the between screen is done showing. If you had, let us say, 'Level1' and 'Level2' as game worlds and 'Intermission' as the between world, then:
Adding a message in the Breakout Scenario.
By ddcook82, with 7 replies.
Last reply by danpost, over 13 years ago:
It is done basically the same way as when you create the message manually. <Code Omitted>This creates the object and holds it in a field called 'msg'; now you just need to add 'msg' into the world where you want it.
Error with a scrolling world.
By steved, with 9 replies.
Last reply by bourne, over 13 years ago:
No problem.
Slow down moving speed
By ZekeroXBlade, with 5 replies.
Last reply by -nic-, over 13 years ago:
cool
Player keeps getting stuck on the "Rock" object
By Blakehammond, with no replies.
It is still a far bit away from the object but for some reason the player keeps getting stuck on the rocks, why is this happening? and I am using the "Rock" which came with the program.
Missile shooting question
By leeyong0, with 3 replies.
Last reply by steved, over 13 years ago:
another way you could do it is set some kind of reload timer so that if you hold the hey down it fires once every so often.
Need help with accesing a variable from another actor
By relthix, with 3 replies.
Last reply by davmac, over 13 years ago:
You need to post your code. Either post the relevant parts here, or upload your scenario with source code and post the link to it here.
Animating an object
By Gingervitis, with 28 replies.
Last reply by steved, over 13 years ago:
@laziaf you should probably start a new topic you know. It would be alot more effective...
if intersect method
By leeyong0, with 1 reply.
Replied to by danpost, over 13 years ago:
You seem to be showing the wrong code every time you post a question. When asking about trying to shoot one missle at a time, you should have shown the class with the shoot method in it. Here, you ask about the missle intersecting a ship and should have shown the Missle class. Anyway, I saw your code for the Missle class from you other discussion post and cleaned it up a bit to the following:
Memory Error?
By himynameis, with 1 reply.
Replied to by danpost, over 13 years ago:
Showing the whole error message may help. Although, in this case, it may not; as it probably deals with very large or a multitude of images. When the error occurs may be a clue as to where to look. If you cannot figure it out, you may have to post your code one class as a time, starting with your initial world class.
Button not restarting game
By xxhero24xx, with 4 replies.
Last reply by xxhero24xx, over 13 years ago:
that works. Thanks Dan
873
874
875
876
877
878
879
X