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
Code Help
By RobiJefferson, with 3 replies.
Last reply by danpost, almost 12 years ago:
A simple (though somewhat lengthy) class for what you are looking for could be the following. This class creates an image that displays a framed area containing any number of hearts, each one representing a life for the character that the user controls. You will need to set the image of this class to "herz.png" located in the 'symbols' category. This is just to copy the image file into the images folder of your scenario. Afterwards, you can reset the image of this class to 'No image' (if you wish).
button
By mellotelli45, with no replies.
how do you create the code for the button to get straight through to my game and to the instructions.
platform shaking effect
By ronzhi, with 5 replies.
Last reply by ronzhi, almost 12 years ago:
wow it's even better than before, you rock ! great thanks danpost
Shooting randomly
By LittleJacob, with 4 replies.
Last reply by LittleJacob, almost 12 years ago:
Thnks
shooting space invaders
By LittleJacob, with 14 replies.
Last reply by LittleJacob, almost 12 years ago:
Thank you it works now
Actor not in world help
By GreenGoo, with 4 replies.
Last reply by danpost, almost 12 years ago:
There are many things that can be improved upon. Using 'getObjects(Shape.class).size()' would be better than having a field keep track of objects in the world. Having 'inWorld' in the actor class is meaningless as all actors that are acted on ARE in the world. Line 10 above, will still error when the shape is removed by the mouse (switch the order of lines 9 and 10). I am not sure if you want a constant value for 'colourChance' or not; but, if the color of the squares are to change back and forth during execution, remove the field and use 'Greenfoot.getRandomNumber(2)<1' anywhere in the c
actual and formal arguments lists differ in length
By LittleJacob, with 3 replies.
Last reply by LittleJacob, almost 12 years ago:
Thanks so much for the quick and helpful replies - really appreciate it! It's working great now. :)
Scrolling game
By sallywallee, with 5 replies.
Last reply by sallywallee, almost 12 years ago:
Thank you mr GreenGoo
coding problem
By Banginwithflavor, with 23 replies.
Last reply by danpost, almost 12 years ago:
I see one problem immediately. Neither barrel nor target should be sub-classes of player (they both should 'extend Actor'). Move the methods related to the angle of the barrel from the player class to the barrel class. Move the 'checkTarget' method from the player class to the target class and call it from the act method, there.
what does this mean and how to sovle it?
By Avik, with 4 replies.
Last reply by Avik, almost 12 years ago:
thank you very much
help please
By Alaska, with 1 reply.
Replied to by danpost, almost 12 years ago:
Use the GreenfootImage 'scale' method on the image.
hi
By Alaska, with 1 reply.
Replied to by Kartoffelbrot, almost 12 years ago:
Make two classes, one for each player. Then make a method to control, move, turn (how do you want) the first class. Copy it into the other and change the key bindings. If you have more questions, ask.
Help
By WolfMan12, with 2 replies.
Last reply by WolfMan12, almost 12 years ago:
thank you
Collision Detection
By lgbrf, with 9 replies.
Last reply by danpost, almost 12 years ago:
Here is what I see: your act method has three method calls in it. First a call to 'move' (all well and good). Then, a call to attackCharacter, which is an empty method. Finally, a call to 'hitCharacter', which returns the value of a boolean field. This boolean value is not used in any way and the 'moveTowardCharacter' is never called (anywhere).
Need some help with basic pacman
By jaydjay, with 6 replies.
Last reply by danpost, almost 12 years ago:
It seems a bit wasteful moving back and forth, like that, we could replace the code from line 11 on with: <Code Omitted>
841
842
843
844
845
846
847
X