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
hi
By Alaska, with 1 reply.
Replied to by Kartoffelbrot, over 13 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 13 years ago:
thank you
Collision Detection
By lgbrf, with 9 replies.
Last reply by danpost, over 13 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 13 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 13 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 13 years ago:
Thanks , works perfectly!
delay issues
By Banginwithflavor, with 5 replies.
Last reply by Banginwithflavor, over 13 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 13 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>
scrolling back ground
By Avik, with 1 reply.
Replied to by GreenGoo, over 13 years ago:
Try this : http://www.greenfoot.org/scenarios/6719
Getting Enemies to Follow the Player
By cecarson, with 1 reply.
Replied to by Avik, over 13 years ago:
public void act() { moveIt(); followHuman(); RandMove(); } public void moveIt() { move(2); if(atWorldEdge()) { turn(5); } } public void RandMove() { if(Greenfoot.getRandomNumber(100)>20) { turn(Greenfoot.getRandomNumber(20)-10); } } public void followHuman() { String target; getObjectsInRange(400,Survivor.class); int targetX = getX(); int targetY
hi
By Alaska, with 1 reply.
Replied to by holla, over 13 years ago:
<Code Omitted>and <Code Omitted>
sorry
By Alaska, with no replies.
*object
Let objects in my world intersect with each other
By geekykid2013, with 2 replies.
Last reply by danpost, over 13 years ago:
You could use a string whose different characters represent different object types. Iterate through the string to place the objects in the world. For example (sort of a template):
counter
By GrimCreeper312, with 3 replies.
Last reply by danpost, over 13 years ago:
You can add a secondary constructor, adjust the 'updateImage' method and, if you want (or need) to, add a method to change (or set) the prefix. You will also have to add an instance String field to hold the prefix.
How to draw a Polygon ?
By Clem, with 2 replies.
Last reply by Clem, over 13 years ago:
The drawing works, thanks a lot !
847
848
849
850
851
852
853
X