Snake game for a 5x5 LED matrix
Diff: snake.h
- Revision:
- 2:9c075a0a6d4e
- Parent:
- 1:5fcb94bb03db
--- a/snake.h Thu Oct 17 04:32:58 2013 +0000 +++ b/snake.h Thu Oct 17 22:09:22 2013 +0000 @@ -7,7 +7,7 @@ #define SNAKE_H // Macros -#define START_DIRECTION Up +#define START_DIRECTION Down #define START_SPEED 10 // Zero indexed number of columns and rows #define NUM_COLS 4 @@ -31,13 +31,13 @@ std::list<bodyPiece> snakeBody; // Function Prototypes - char moveSnake(ledCube cube); // Moves the snake by one in the direction of movementDirection + char moveSnake(ledCube *cube); // Moves the snake by one in the direction of movementDirection // Will return 1 if out of bounds or if the head has hit a bodyPiece, 0 if still in the boundaries void addPiece(); // Adds a bodyPiece to the tail bool isEating(char foodRow, char foodCol); private: - char move(char newHeadRow, char newHeadCol, ledCube cube); + char move(char newHeadRow, char newHeadCol, ledCube *cube); }; class food