hgftf
Dependencies: mbed wave_player 4DGL-uLCD-SE MMA8452
snake.cpp@3:bb6f73642f01, 2020-11-16 (annotated)
- Committer:
- ajorgih3
- Date:
- Mon Nov 16 20:38:03 2020 +0000
- Revision:
- 3:bb6f73642f01
- Parent:
- 2:4947d6a82971
- Child:
- 5:5953ca12205d
y
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
DCchico | 2:4947d6a82971 | 1 | // Copyright 2020 Georgia Tech. All rights reserved. |
DCchico | 2:4947d6a82971 | 2 | // The materials provided by the instructor in this course are for |
DCchico | 2:4947d6a82971 | 3 | // the use of the students currently enrolled in the course. |
DCchico | 2:4947d6a82971 | 4 | // Copyrighted course materials may not be further disseminated. |
DCchico | 2:4947d6a82971 | 5 | // This file must not be made publicly available anywhere. |
DCchico | 2:4947d6a82971 | 6 | |
DCchico | 1:10330bce85cb | 7 | #include "snake.h" |
DCchico | 1:10330bce85cb | 8 | |
DCchico | 1:10330bce85cb | 9 | void snake_init (Snake * s) |
DCchico | 1:10330bce85cb | 10 | { |
ajorgih3 | 3:bb6f73642f01 | 11 | s->score = 0; |
ajorgih3 | 3:bb6f73642f01 | 12 | s->length = 3; |
ajorgih3 | 3:bb6f73642f01 | 13 | s->head_px = 0; |
ajorgih3 | 3:bb6f73642f01 | 14 | s->head_py = 0; |
ajorgih3 | 3:bb6f73642f01 | 15 | s->head_y = 0; |
ajorgih3 | 3:bb6f73642f01 | 16 | s->head_x = 0; |
ajorgih3 | 3:bb6f73642f01 | 17 | s->tail_x = 0; |
ajorgih3 | 3:bb6f73642f01 | 18 | s->tail_y = 0; |
ajorgih3 | 3:bb6f73642f01 | 19 | s->tail_px = 0; |
ajorgih3 | 3:bb6f73642f01 | 20 | s->tail_py = 0; |
ajorgih3 | 3:bb6f73642f01 | 21 | s->body_px = 0; |
ajorgih3 | 3:bb6f73642f01 | 22 | s->body_py = 0; |
ajorgih3 | 3:bb6f73642f01 | 23 | s->body_y = 0; |
ajorgih3 | 3:bb6f73642f01 | 24 | s->body_x = 0; |
ajorgih3 | 3:bb6f73642f01 | 25 | s->head_pi = 0; |
ajorgih3 | 3:bb6f73642f01 | 26 | s->body_pi = 0; |
ajorgih3 | 3:bb6f73642f01 | 27 | s->tail_pi = 0; |
ajorgih3 | 3:bb6f73642f01 | 28 | s->head_pj = 0; |
ajorgih3 | 3:bb6f73642f01 | 29 | s->body_pj = 0; |
ajorgih3 | 3:bb6f73642f01 | 30 | s->tail_pj = 0; |
ajorgih3 | 3:bb6f73642f01 | 31 | for (int i = 0; i < SNAKE_MAX_LENGTH; i++) { |
ajorgih3 | 3:bb6f73642f01 | 32 | s->locations[i].x = 0; |
ajorgih3 | 3:bb6f73642f01 | 33 | s->locations[i].y = 0; |
ajorgih3 | 3:bb6f73642f01 | 34 | } |
ajorgih3 | 3:bb6f73642f01 | 35 | s->score = 0; |
DCchico | 1:10330bce85cb | 36 | } |