Closed adamjw closed 9 years ago
Drawing a triangle is kind of a pain in the ass. Here's an example of a switch statement that you can use on the Snake's facing direction to determine the orientation of the triangle:
http://docs.oracle.com/javase/tutorial/java/javaOO/enum.html
Drawing the square and the triangle uses a method similar to drawing the line.
This is the Colour
class: https://github.com/adamjw/SnakeWS/blob/master/Projects/SimpleIo/src/simpleio/common/Colour.java
If you write Colour colour;
and Eclipse underlines it with red, it's probably complaining that it doesn't know which class you're talking about (I'm not sure if this will actually happen). Hover over the red line to see the error, and it will suggest some classes to import. Select the one from simpleio
so it knows which class you want.
Implement the necessary code to draw the snake and fruit to the screen.
Start by implementing
drawSquare
anddrawTriangle
insnake.game.drawer.BoardDrawer
. Then implementdrawFruit
insnake.game.drawer.FruitDrawer
anddrawSnake
insnake.game.drawer.SnakeDrawer
.Acceptance Criteria: