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
enemy?
By theuberjew, with 1 reply.
Replied to by Gevater_Tod4711, over 11 years ago:
If you just want an enemy you should look at a little-crab game. This ones are the simpelst scenarios. If you download a scenario you can look at the source.
Probably Small Conway's Game of Life Problem...
By camsterb, with 8 replies.
Last reply by danpost, over 11 years ago:
From any cell, there are eight possible neighbours, they occur at offsets of <Code Omitted>The x-offsets range from negative one to one; as do the y-offsets. The hole in the center is the current cell which is not a neighbour of itself. The first 'for' loop creates the values of the x-offsets and the second does the same for the y-offsets. The first 'if' eliminates self-neighbouring. The second one eliminates non-existent cells outside the world bounds. The last one checks the status of t
turnTowards problem
By DaBist, with 5 replies.
Last reply by DaBist, over 11 years ago:
Duta wrote...
I assume what you mean is that you want to be able to do <Code Omitted>but not have the rotation change. One way to do this is to store what the rotation was before turnTowards, and then set it back to the original rotation after it's done. What I'm trying to say is: <Code Omitted>
thanks, it works now :)
Make actors appear
By Peach, with no replies.
Hi, is it possible to do this: When the Crab eats 10 green worms (the score=10) , then the red worms will start to appear. What would the code be? I've got the first line: if (counter.getValue() == 10) {
Newish Greenfooter HELP! :) - Turning String name into Greenfoot Image
By TehDoctor, with 13 replies.
Last reply by TehDoctor, over 11 years ago:
That would work, but I want to make it even simpler because all 24 letters build off the 3 base letters. So although B is that strange half circle with a line, an M would be the same letter with just a line sticking out of it. So i just created the 3 base letters and a line. Then ill attach them together to make characters in the code. I may just set up 24 separate if statements for each letter. Unless there's some possible way to perform the toString() method backwards :D
Hockey Game Boundary Collision Problems
By camsterb, with no replies.
Hi. I'm looking for a formula to use to change the trajectory of a hockey player bouncing and sliding around a rectangle through use of the inbuild move method. <Code Omitted> This method seems to work perfectly, but sometimes the player manages to get stuck beyond the boundaries. The object rotates left and right with keypresses. It moves in the direction in is facing. Maybe it's to do with turning the object while bouncing off a wall? Anyway, here is the link to observe what I mean: http://www.greenfoot.org/scenarios/7181 I'm looking for criticism of my method and advice to solve my problem of moving beyond boundaries. Thanks As an additional question: I want to be able to shoot the puck and give it the current rotation of the hockey player. This allows the puck to move that direction. I have some code already for this, but there are glitches. I will post more details at request. All the code is visible in the link.
Compile error?
By erdelf, with 4 replies.
Last reply by erdelf, over 11 years ago:
oh damn, I know what the problem is, I forgot for a moment that the string class is an actual class and wrote a new class called String, sry for bothering you
actor not in world
By KierTulp, with 1 reply.
Replied to by KierTulp, over 11 years ago:
I just fixed the magnet one, it was because I had the getX() and getY() thingies in there.
Need help please! re adding a removed object
By ddavid33, with 5 replies.
Last reply by LordBeno, over 11 years ago:
oh my bad xD
All Nighter
By BradH, with 10 replies.
Last reply by danpost, over 11 years ago:
Ctrl-Shift-I properly indents your code (it is the shortcut for Edit>Auto-layout within the code pane).
How is the world divided in cells? Problems with getObjectsInRange()
By JimmyFake, with 7 replies.
Last reply by JimmyFake, over 11 years ago:
I had some time, to try out what you posted danpost. My assumption was right, even though I may have expressed myself, incorrectly. For now the ObjectsInRange method works better for me, because an circular radius is fine for now, and the code is simpler. And thanks to GevaterTod, I do now know, how to use that command :) But if I want to adapt the area of the radius, because of some reasons that might appear in future, your advice would come in handy, danpost. Thank you both, again :D
How do I get the direction an Actor is moving?
By Oxy, with 3 replies.
Last reply by Oxy, over 11 years ago:
yup, that was what the problem was thanks danPost
incompatible types
By KierTulp, with 13 replies.
Last reply by vonmeth, over 11 years ago:
Edit: nm
incompatible types with range
By KierTulp, with 2 replies.
Last reply by Gevater_Tod4711, over 11 years ago:
If you want to prove if there is an object type uman near you, you should change the method like this: <Code Omitted>
How do you set the world using buttons that the mouse clicks on?
By LonelyCreeper, with 2 replies.
Last reply by LonelyCreeper, over 11 years ago:
Oh I solved it. Thanks anyways though.
887
888
889
890
891
892
893
X