Topic 1 - Variables and Data Types
Topic 2 - Conditionals and Strings
Topic 3 - Loops
Topic 4 - Arrays
Topic 5 - File Handling
Semester 1 Projects
Topic 6 - Classes/Objects and Methods
Topic 7 - ArrayLists
Semester Projects

Part 1d: Key Press

In SnakeProBrain.java -> keyPressed():

Fill in the blanks within keyPressed in SnakeProBrain.java so that when you press the relevant key, the direction is set using the methods in SnakeProData.java (setDirectionNorth(), setDirectionSouth(), setDirectionEast(), setDirectionWest() ). Make sure you use the private static final variables like the examples that use AI_MODE and REVERSE

While you can write this code using “if”, you are probably better off learning to use switch statements:

Of course, nothing will happen yet when you press the ‘a’ or ‘r’ keys (i.e., there won’t be an AI mode or reverse functionality because you haven’t written the code for that functionality yet). 

Tests

After completing this step you should be able to run SnakeProBrain.java and play your Snake Pro game!  There are no specific tests for this but you should play the game to make sure that it works well.