Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed wave_player 4DGL-uLCD-SE MMA8452
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);
Generated on Mon Aug 1 2022 15:08:58 by
