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.
food/food.cpp@2:430dcf420840, 2020-06-05 (annotated)
- Committer:
- jahanzebkhan
- Date:
- Fri Jun 05 22:51:49 2020 +0000
- Revision:
- 2:430dcf420840
Final Submission. I have read and agreed with Statement of Academic integrity.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
jahanzebkhan | 2:430dcf420840 | 1 | #include "food.h" |
jahanzebkhan | 2:430dcf420840 | 2 | |
jahanzebkhan | 2:430dcf420840 | 3 | Food::Food() |
jahanzebkhan | 2:430dcf420840 | 4 | { |
jahanzebkhan | 2:430dcf420840 | 5 | } |
jahanzebkhan | 2:430dcf420840 | 6 | |
jahanzebkhan | 2:430dcf420840 | 7 | Food::~Food() |
jahanzebkhan | 2:430dcf420840 | 8 | { |
jahanzebkhan | 2:430dcf420840 | 9 | } |
jahanzebkhan | 2:430dcf420840 | 10 | |
jahanzebkhan | 2:430dcf420840 | 11 | void Food::init(){ |
jahanzebkhan | 2:430dcf420840 | 12 | fo_x = 16; |
jahanzebkhan | 2:430dcf420840 | 13 | fo_y = 38; |
jahanzebkhan | 2:430dcf420840 | 14 | |
jahanzebkhan | 2:430dcf420840 | 15 | chng_food = false; |
jahanzebkhan | 2:430dcf420840 | 16 | } |
jahanzebkhan | 2:430dcf420840 | 17 | |
jahanzebkhan | 2:430dcf420840 | 18 | void Food::food_location(N5110 &lcd){ |
jahanzebkhan | 2:430dcf420840 | 19 | if (chng_food == true){ |
jahanzebkhan | 2:430dcf420840 | 20 | chng_food = false; |
jahanzebkhan | 2:430dcf420840 | 21 | lcd.setPixel(fo_x, fo_y, 0); |
jahanzebkhan | 2:430dcf420840 | 22 | fo_x = rand()%84; |
jahanzebkhan | 2:430dcf420840 | 23 | fo_y = rand()%48; |
jahanzebkhan | 2:430dcf420840 | 24 | } |
jahanzebkhan | 2:430dcf420840 | 25 | } |