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
Making enemies turn around once past main character
By n15, with 1 reply.
Replied to by n15, over 9 years ago:
Can anyone help?
My Counter is not working? Please Help
By coder04, with 1 reply.
Replied to by danpost, over 9 years ago:
First, I see no code that tries to change the value of any Counter object (in fact, I do not see any "eating" either). Then, I see that the Counter object held by the 'counter' field is not going to be the same Counter object that you place into the world (remove line 34 -- so that the Counter object already created and saved in the 'counter' field is added into the world on the next line).
Turn in the direction its moving?
By coder04, with 4 replies.
Last reply by danpost, over 9 years ago:
coder04 wrote...
Ah So when you press the up key the actor moves forward but the actor does not turn to face that direction aswell. I tried using the turn(90) but nothing happened
First, it is strange to see the vertical movement speed ( 4 ) being faster than the horizontal movement speed ( 3 ). Next, with the current code, by not using 'else if' structures, you will are allowing diagonal movement as well. Unfortunately, even though diagonal movement are avoided, some directions will supersede others with that. There are other ways to code key controls that avoid diagonal movement an
HELP!!! cannot find symbol- class
By Elexios, with 9 replies.
Last reply by Super_Hippo, over 9 years ago:
You mixed up 'Cactus' and 'Catcus' as you may already noticed.
Need help with AI firing in multiple (fixed) directions at the same time
By kinghunter, with 7 replies.
Last reply by Super_Hippo, over 9 years ago:
Yes and you need to change i<4 to i<8.
Stop moving when hitting objects
By MrPancakes, with 4 replies.
Last reply by MrPancakes, over 9 years ago:
I fixed with your code danpost. Thank you very much
is anyone here can help me writing a while loop for a Z pattern?
By MLP, with 6 replies.
Last reply by MLP, over 9 years ago:
thank you so much
Line break
By Lio1020, with 1 reply.
Replied to by Super_Hippo, over 9 years ago:
Write \n at the position you want a new line to begin.
How can an object hide or remove itself?
By JohnOfStony, with 1 reply.
Replied to by Super_Hippo, over 9 years ago:
To make the world unbounded: Double click your world subclass. Find the first line in the world constructor and add another parameter 'false', e.g.: <Code Omitted>To make an object remove itself from the world, use the 'this' keyworld: <Code Omitted>
Physics in 2D raycasting Engine
By wabuilderman, with 2 replies.
Last reply by wabuilderman, over 9 years ago:
The 'MoveWithPhysics' function is essentially drawing a line segment between my current location, and the new desired location. If this movement line were to intersect any wall, I want to place the player slightly behind the point of the collision (that way he isn't stuck in the wall). As for the fisheye-effect, thanks for the tip. I will look into that. Also, interesting fact about doom. I hadn't realized that.
Edit the IceBurgs so that they move and turn randomly.
By JamesHughes244, with 1 reply.
Replied to by danpost, over 9 years ago:
JamesHughes244 wrote...
How would I edit an object to turn and move randomly in an 8 by 8 grid world.
First, I would add fields for a pre-determined destination grid-square: <Code Omitted>The initial value of these fields should be the coordinate values of the location the actor was placed into the world at. The 'addedToWorld' method can be used for this (so you can use 'getX' and 'getY' to set the value of the fields with). Then, to make things a bit easier, we will alternate between moving horizontally and moving vertically. This will mean only one tu
Facing in the direction of movement
By JamesHughes244, with 4 replies.
Last reply by JamesHughes244, over 9 years ago:
Thats great, thanks SPower and danpost
Eating worms
By Aquariusnights, with 1 reply.
Replied to by wabuilderman, over 9 years ago:
Um, assuming that you followed the tutorial word for word, it should work 100% of the time. Double check your code and make sure everything is exactly the same. If all else fails, then paste the problematic code here.
Moving randomly in four directions?
By JamesHughes244, with 2 replies.
Last reply by JamesHughes244, over 9 years ago:
Thank you very much, this solution is great! The actor doesnt seem to stay near the same location in reality though so it works fine. Thanks again!
Enemy Health Not Working
By AreebRaza, with 20 replies.
Last reply by danpost, over 9 years ago:
AreebRaza wrote...
is it possible to make enemies with health in one class
What are the differences between the classes?
danpost wrote...
Remove 'static' from the 'health' declarations lines in the Skeleton classes at line 20.
Actually, I do not think anything in those classes should be declared as 'static' (as yet), except for maybe the images. Remove all occurrences of the word 'static' in those classes. Note (do not make any changes for this unless you fully understand or get further help on this): I mentioned the images because currently, as your code is, each en
454
455
456
457
458
459
460
X