Cong Vu / Mbed 2 deprecated Project2_cvu31

Dependencies:   mbed wave_player 4DGL-uLCD-SE MMA8452

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers snake.h Source File

snake.h

00001 // Copyright 2020 Georgia Tech.  All rights reserved.
00002 // The materials provided by the instructor in this course are for
00003 // the use of the students currently enrolled in the course.
00004 // Copyrighted course materials may not be further disseminated.
00005 // This file must not be made publicly available anywhere.
00006 
00007 #define SNAKE_MAX_LENGTH 50
00008 
00009 // Structure of coordinates in the map
00010 typedef struct{
00011     int x;
00012     int y;
00013 } Coordinate;
00014 
00015 // Snake Structure
00016 typedef struct {
00017     int head_x, head_y, head_px, head_py; // Location of the head of the snake
00018     int length; // length of the snake
00019     Coordinate locations[SNAKE_MAX_LENGTH]; // Snake body locations
00020     int score; //Current score of the snake
00021     int pointLockTime;
00022     int speedupTime;
00023     int slowdownTime;
00024     bool invincible;
00025     int invincTimer;
00026 } Snake;
00027 
00028 // Initialize a snake structure
00029 // You want to assign initial values to each of the variables defined above
00030 // in the snake structure.
00031 void snake_init (Snake * snake);