project for 2035

Dependencies:   mbed wave_player 4DGL-uLCD-SE MMA8452

snake.h

Committer:
DCchico
Date:
2020-10-23
Revision:
1:10330bce85cb
Child:
2:4947d6a82971

File content as of revision 1:10330bce85cb:

#define SNAKE_MAX_LENGTH 50

// Structure for holding detailed information about the snake
typedef struct{
    int speed;
    int speed_up_duration;
    bool go_through_wall;
} Status;

// Structure of coordinates in the map
typedef struct{
    int x;
    int y;
} Coordinate;

// Snake Structure
typedef struct {
    int head_x, head_y, head_px, head_py; // Location of the head of the snake
    int length; // length of the snake
    Coordinate locations[SNAKE_MAX_LENGTH]; // Snake body locations
    Status snake_status; // Stauts of the snake
    int score; //Current score of the snake
} Snake;

// Initialize a snake structure
// You want to assign initial values to each of the variables defined above
// in the snake structure.
void snake_init (Snake * snake);