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
How do I get one object to follow another?
By TheMemeMan, with 1 reply.
Replied to by Super_Hippo, about 9 years ago:
Well, right now, it it does not really switch to the other side. To let them turn to the player, you can use the 'turnTowards' method. To make it work, you need a reference to the player objects. And you need some rule to decide which player to follow if there are two. To stop them from overlapping, check for intersecting between zombies after they moved and then, move back if they moved on another zombie.
Need help with getting counter to work plz
By JWK3986, with 1 reply.
Replied to by Super_Hippo, about 9 years ago:
Show what you have tried.
need help! Greenfoot 3.5
By johnnysins, with no replies.
I 100% need help doing this! You are the pilot of a plane that has been sent out to pick up barrels that have fallen off a cargo ship. By flying over a barrel you will automatically collect it. The problem is that sea is rough and the barrels keep going under the water, so you have to collect them when they are at the surface. To make matters worse the area is a rocket testing site for rockets from NASA and they are unable to stop these being fired into the same area that you are in! You are going to program the above game. The plane will always be moving but we can control its left and right turning. Flying over a barrel will mean you collect it and search for the next one. Collecting a barrel will give us a score point. The barrel will randomly appear on the screen, but only stay for a set amount of time and then go under and re-appear randomly elsewhere on the screen. The rockets will appear at the top of the screen then randomly move down the screen until they disappear off the map. You must not hit the rocket. It is estimated that you will be able to survive 3 direct rocket hits and then the game will be over. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners. 3 Open course scenario “JF_3_5_Practice_Start”. 12. Create a sub class of the World class called BarrelWorld with the dimensions 800 x 600. Use the scenario image wet-blue.jpg as the scenario image. 13. Create a subclass of Actor called Plane and use the image airplane1. 14. Create a subclass of Actor called Barrel and use the image Barrel. 15. Create a subclass of Actor called Rocket and use the image rocket1. 16. Add code to automatically add a Barrel to the top left. 17. Add code to add a Rocket to the top of the screen. This code will randomly generate the x-coordinate and set the y coordinate to 10. 18. Add code to automatically add the plane instance to the middle of the screen. 19. Add code to the Plane class to have it constantly move forward at a speed of 2 and turn left when the left arrow key is pressed or right when the right arrow key is pressed. It will turn 2 degrees.
actor problem
By Dayuyu, with no replies.
The coding in my game is when main actor touch M29 actor can insert another world... soalan29 is fine but soalanbos1 cannot insert the another world or because the picture not same.... i set all picture same except soalanbos1... i have many question all doing fine except soalanbos1.. <Code Omitted>
score problem
By Dayuyu, with 19 replies.
Last reply by danpost, about 9 years ago:
Dayuyu wrote...
yes i have about 12question so the world that have question have 12....i name the world like Q - Q6 for level 1... and level 2 Q21 - Q29..
In your Background1 world class: <Code Omitted>Then, in your Background1 world constructor, add the following line: <Code Omitted>This will allow any of your Q classes o
Object jump
By nush99, with 2 replies.
Last reply by nush99, about 9 years ago:
thank you so much!!
Call an object's method
By Aniveal, with 3 replies.
Last reply by Aniveal, about 9 years ago:
Thanks for the replies! Adding the (Terrain) helped. @danpost: You are right, that's exactly what I wanted. I think I would have found that out after testing though ;)
Power up two adjacent bullets programming
By tisoc2009, with 5 replies.
Last reply by Super_Hippo, about 9 years ago:
If you show your code, it will be easier for us to help you.
changing text size in world
By FaintingSatyr, with 1 reply.
Replied to by danpost, about 9 years ago:
You cannot adjust the size of the text that 'showText' uses. You can have the keys place its keyboard key value on themselves within the constructor of the Key class. There, you can create an image with text of any size and draw it onto the image of the key. You would be creating an object of and using methods of the GreenfootImage class (see documentation).
Help With mouseClicked
By AAkira, with 8 replies.
Last reply by danpost, about 9 years ago:
Okay, that eliminates one possibility. Now, post your entire Property class.
Making objects stay on top of other objects
By ymym, with 3 replies.
Last reply by Super_Hippo, about 9 years ago:
It should be 'direction' and not 'dir' in all cases in the act-method. Looks like I messed this up.
Two Enemies that follow error.
By Samas, with 4 replies.
Last reply by Samas, about 9 years ago:
Thank you!
Null Pointer Exception
By ymym, with 3 replies.
Last reply by danpost, about 9 years ago:
ymym wrote...
could you explain why 'getWorld' returns 'null' when 'this' is removed though? I'm fairly new to Greenfoot.
When you remove 'this' from the world, then 'this' will not be in any world. Therefore, calling 'getWorld' on 'this' actor will return the world that actor is in. If it is not currently in any world, 'null' is returned. Maybe it would help to explain that: <Code Omitted>is equivalent to: <Code Omitted>So, if 'this' is removed from the world, 'this.getWorld', which returns the world the actor is in, cannot
Player onstantly adding without eating and help with other ideas
By Boboy18, with 21 replies.
Last reply by Boboy18, about 9 years ago:
Great again it all works. Thanks again. I'm trying to work on 'lives' for the user. I will ask if there is any problems. ;)
Help with animating this boney guy.
By shloid, with 5 replies.
Last reply by danpost, about 9 years ago:
shloid wrote...
Oops I apologize I did not see the link on "Animated Character" hahaha. But thank you in advance.
I was looking over the code of the Animated Character scenario. It may be a bit complicated to understand. However, the main thing is that the parts be controlled together from one set of code. They should not be controlled independently. This means the code should be located in a class where only one instance is created. Unfortunately, that would exclude your Boss class as all objects of its subclasses are also considered Boss objects. Actually, it was incorrect for yo
440
441
442
443
444
445
446
X