This site requires JavaScript, please enable it in your browser!
Greenfoot back
johnnysins
johnnysins wrote ...

2016/9/28

need help! Greenfoot 3.5

johnnysins johnnysins

2016/9/28

#
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.
You need to login to post a reply.