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.cpp
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 #include "snake.h" 00008 00009 void snake_init (Snake * s) 00010 { 00011 s->head_x = 5; 00012 s->head_px =0; 00013 s->head_y = 5; 00014 s->head_py =0; 00015 s->length = 3; 00016 00017 for (int i = 0; i < SNAKE_MAX_LENGTH; i++) { 00018 s->locations[i].x = s->head_x - i; 00019 s->locations[i].y = s->head_y; 00020 } 00021 00022 s->pointLockTime = 0; //Time that snake can't gain points 00023 s->speedupTime = 0; 00024 s->slowdownTime = 0; 00025 s->score = 0; //Current score of the snake 00026 s->invincible = false; 00027 s->invincTimer = 0; 00028 }
Generated on Mon Aug 1 2022 15:08:58 by
