I'm simply looking for any guidance for resolution to a project i was given. Any help is greatly appreciated. please let me know if i need to show StartingClass and Snake classes for more info.
this is a java applet allows a user to play Snake game, it was created with 4 different classes in the package exam1 : StartingClass, GameException, Snake, Point.
The driver class for the applet is named "StartingClass" and contians a series of strings and default values.
For this project i need to review the code and make the following adjustments:
1. Adjust the Title of the Applet so it is named "Tiger Snake" the current name is "Snakes Game" - DONE in StartingClass
2. Create a class named {Netid}A06 in the default package. - DONE
3. Create an instance of "exam1.Snake", starting at position 200, 200 on a board that is 800 by 600 - DONE
4. Execute the Snake.move() method 10 times. - Need guidance on this step
5. Execute the Snake.getScore() method and print the following to screen. "Score1: {SCORE}\n" - Need guidance on this step
6. Create a second instance of snake using the same parameters. - DONE
7. Read 30 integers from console using a Scanner's nextInt method. - should be similar to as step 5
8. If a 1 is entered call the snake moveLeft method - Need guidance on this step
If a 2 is entered call the snake moveRight method
If a 3 is entered call the snake moveDown method
If a 4 is entered call the snake moveUp method
In each loop iteration execute the Snake.move method - Need guidance on this step
9. At the end of the loop execute the Snake.getScore() method and print the following to screen. "Score2: {SCORE}\n"
10. Adjust the default difficulty by setting it to 5; - DONE
11. Adjust the instructions so they explain that pressing the number keys adjusts the difficulty. - Need guidance on this step
import exam1.Snake; import java.util. Scanner; public class NetIdA06 { // 2. Create a class named {Netid}A06 in the default package public static void main(String[] args) { Scanner input = new Scanner(System.in); { Snake mySnake1 = new Snake(200, 200, 800, 600); // 3. Create an instance of "exam1.Snake" Snake mySnake2 = new Snake(200, 200, 800, 600); // 6. Create a second instance of snake using the same parameters. } } }
I did not see any examples in the book, watched youtube videos and went through a numerous instructions and still not getting how to call for methods from different classes.