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
Treasure.cpp@2:23b20cbd3330, 2017-05-01 (annotated)
- Committer:
- weixitao
- Date:
- Mon May 01 16:37:53 2017 +0000
- Revision:
- 2:23b20cbd3330
- Parent:
- 1:83459533ff72
four ares and win to welcome
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| weixitao | 0:1465fd20e75b | 1 | #include "Treasure.h" |
| weixitao | 0:1465fd20e75b | 2 | #include "N5110.h" |
| weixitao | 0:1465fd20e75b | 3 | extern N5110 lcd; |
| weixitao | 0:1465fd20e75b | 4 | |
| weixitao | 0:1465fd20e75b | 5 | void Treasure::treasure_place() |
| weixitao | 0:1465fd20e75b | 6 | { |
| weixitao | 0:1465fd20e75b | 7 | |
| weixitao | 0:1465fd20e75b | 8 | |
| weixitao | 0:1465fd20e75b | 9 | TreasureX = rand()%70+5; |
| weixitao | 0:1465fd20e75b | 10 | TreasureY = rand()%30+5; |
| weixitao | 0:1465fd20e75b | 11 | |
| weixitao | 0:1465fd20e75b | 12 | } |
| weixitao | 0:1465fd20e75b | 13 | |
| weixitao | 0:1465fd20e75b | 14 | void Treasure::treasure_show() |
| weixitao | 0:1465fd20e75b | 15 | { |
| weixitao | 0:1465fd20e75b | 16 | |
| weixitao | 0:1465fd20e75b | 17 | lcd.drawRect(TreasureX,TreasureY,10,8,FILL_BLACK); |
| weixitao | 0:1465fd20e75b | 18 | lcd.drawRect(TreasureX+2,TreasureY+1,6,4,FILL_WHITE); |
| weixitao | 0:1465fd20e75b | 19 | lcd.drawRect(TreasureX+4,TreasureY+2,2,2,FILL_BLACK); |
| weixitao | 1:83459533ff72 | 20 | //printf("The treasure is displayed"); |
| weixitao | 0:1465fd20e75b | 21 | |
| weixitao | 0:1465fd20e75b | 22 | } |