Snake game for a 5x5 LED matrix

Dependencies:   MCP23S17 mbed

snake.h

Committer:
dhamilton31
Date:
2013-10-09
Revision:
0:dc906408980e
Child:
1:5fcb94bb03db

File content as of revision 0:dc906408980e:

#include "mbed.h"
#include "bodyPiece.h"
#include <list>


typedef enum {
    Up,Down,Left,Right
} Direction;

class snake
{
public:
    snake(char startRow, char startCol);
    void move(char newHeadRow, char newHeadCol);
    int movementSpeed;
    Direction movementDirection;
    void addPiece();

private:
    std::list<bodyPiece> snakeBody;
    int bodySize;
};

class food
{
public:
    char currRow, currCol;
    food(char row, char col);
    void moveFood(char row, char col);
};