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
shooting space invaders
By LittleJacob, with 14 replies.
Last reply by LittleJacob, over 11 years ago:
Thank you it works now
Actor not in world help
By GreenGoo, with 4 replies.
Last reply by danpost, over 11 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, over 11 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, over 11 years ago:
Thank you mr GreenGoo
coding problem
By Banginwithflavor, with 23 replies.
Last reply by danpost, over 11 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, over 11 years ago:
thank you very much
help please
By Alaska, with 1 reply.
Replied to by danpost, over 11 years ago:
Use the GreenfootImage 'scale' method on the image.
hi
By Alaska, with 1 reply.
Replied to by Kartoffelbrot, over 11 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, over 11 years ago:
thank you
Collision Detection
By lgbrf, with 9 replies.
Last reply by danpost, over 11 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, over 11 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>
Error in code
By geekykid2013, with 7 replies.
Last reply by danpost, over 11 years ago:
One thing I would change is line 32, which I would make: <Code Omitted>
Counter
By Hawx_, with 2 replies.
Last reply by Hawx_, over 11 years ago:
Thanks , works perfectly!
delay issues
By Banginwithflavor, with 5 replies.
Last reply by Banginwithflavor, over 11 years ago:
@Gevater_Tod4711, Thanks a ton! it works fine now :D @danpost, thanks for showing me how to slow it down it was going a bit fast!
Using getUnivX() (danpost's SWorld)
By FlyingRabidUnicornPig, with 5 replies.
Last reply by danpost, over 11 years ago:
To get the x value in world coordinates of the far right side of the scrolling area, then with the new methods, you can use: <Code Omitted>
839
840
841
842
843
844
845
X