Nemesis game, stats
Stats.cpp@8:b8e8e2f335e1, 2017-04-09 (annotated)
- Committer:
- musallambseiso
- Date:
- Sun Apr 09 12:47:00 2017 +0000
- Revision:
- 8:b8e8e2f335e1
- Parent:
- 7:cae9a95427f7
- Child:
- 9:b9ad5e45aebf
Added health drop
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
musallambseiso | 7:cae9a95427f7 | 1 | #include "Stats.h" |
musallambseiso | 5:b822aaa6200d | 2 | |
musallambseiso | 7:cae9a95427f7 | 3 | Stats::Stats() |
musallambseiso | 5:b822aaa6200d | 4 | { |
musallambseiso | 5:b822aaa6200d | 5 | |
musallambseiso | 5:b822aaa6200d | 6 | } |
musallambseiso | 5:b822aaa6200d | 7 | |
musallambseiso | 7:cae9a95427f7 | 8 | Stats::~Stats() |
musallambseiso | 5:b822aaa6200d | 9 | { |
musallambseiso | 5:b822aaa6200d | 10 | |
musallambseiso | 5:b822aaa6200d | 11 | } |
musallambseiso | 5:b822aaa6200d | 12 | |
musallambseiso | 7:cae9a95427f7 | 13 | void Stats::draw_health(N5110 &lcd) |
musallambseiso | 7:cae9a95427f7 | 14 | { |
musallambseiso | 7:cae9a95427f7 | 15 | lcd.drawLine(76,40,77,40,1); |
musallambseiso | 7:cae9a95427f7 | 16 | lcd.drawLine(79,40,80,40,1); |
musallambseiso | 7:cae9a95427f7 | 17 | lcd.drawLine(75,41,75,43,1); |
musallambseiso | 7:cae9a95427f7 | 18 | lcd.drawLine(81,41,81,43,1); |
musallambseiso | 7:cae9a95427f7 | 19 | lcd.setPixel(78,41); |
musallambseiso | 7:cae9a95427f7 | 20 | lcd.setPixel(76,44); |
musallambseiso | 7:cae9a95427f7 | 21 | lcd.setPixel(80,44); |
musallambseiso | 7:cae9a95427f7 | 22 | lcd.setPixel(77,45); |
musallambseiso | 7:cae9a95427f7 | 23 | lcd.setPixel(79,45); |
musallambseiso | 7:cae9a95427f7 | 24 | lcd.setPixel(78,46); |
musallambseiso | 5:b822aaa6200d | 25 | } |
musallambseiso | 8:b8e8e2f335e1 | 26 | |
musallambseiso | 8:b8e8e2f335e1 | 27 | void Stats::check_health(N5110 &lcd, int collisions) |
musallambseiso | 8:b8e8e2f335e1 | 28 | { |
musallambseiso | 8:b8e8e2f335e1 | 29 | if (collisions == 0) |
musallambseiso | 8:b8e8e2f335e1 | 30 | { |
musallambseiso | 8:b8e8e2f335e1 | 31 | lcd.drawLine(76,41,80,41,1); |
musallambseiso | 8:b8e8e2f335e1 | 32 | lcd.drawLine(76,42,80,42,1); |
musallambseiso | 8:b8e8e2f335e1 | 33 | lcd.drawLine(76,43,80,43,1); |
musallambseiso | 8:b8e8e2f335e1 | 34 | lcd.drawLine(77,44,79,44,1); |
musallambseiso | 8:b8e8e2f335e1 | 35 | lcd.setPixel(78,45); |
musallambseiso | 8:b8e8e2f335e1 | 36 | } |
musallambseiso | 8:b8e8e2f335e1 | 37 | else if (collisions == 1) |
musallambseiso | 8:b8e8e2f335e1 | 38 | { |
musallambseiso | 8:b8e8e2f335e1 | 39 | lcd.drawLine(76,42,80,42,1); |
musallambseiso | 8:b8e8e2f335e1 | 40 | lcd.drawLine(76,43,80,43,1); |
musallambseiso | 8:b8e8e2f335e1 | 41 | lcd.drawLine(77,44,79,44,1); |
musallambseiso | 8:b8e8e2f335e1 | 42 | lcd.setPixel(78,45); |
musallambseiso | 8:b8e8e2f335e1 | 43 | } |
musallambseiso | 8:b8e8e2f335e1 | 44 | else if (collisions == 2) |
musallambseiso | 8:b8e8e2f335e1 | 45 | { |
musallambseiso | 8:b8e8e2f335e1 | 46 | lcd.drawLine(76,43,80,43,1); |
musallambseiso | 8:b8e8e2f335e1 | 47 | lcd.drawLine(77,44,79,44,1); |
musallambseiso | 8:b8e8e2f335e1 | 48 | lcd.setPixel(78,45); |
musallambseiso | 8:b8e8e2f335e1 | 49 | } |
musallambseiso | 8:b8e8e2f335e1 | 50 | else if (collisions == 3) |
musallambseiso | 8:b8e8e2f335e1 | 51 | { |
musallambseiso | 8:b8e8e2f335e1 | 52 | lcd.drawLine(77,44,79,44,1); |
musallambseiso | 8:b8e8e2f335e1 | 53 | lcd.setPixel(78,45); |
musallambseiso | 8:b8e8e2f335e1 | 54 | } |
musallambseiso | 8:b8e8e2f335e1 | 55 | else if (collisions == 4) |
musallambseiso | 8:b8e8e2f335e1 | 56 | { |
musallambseiso | 8:b8e8e2f335e1 | 57 | lcd.setPixel(78,45); |
musallambseiso | 8:b8e8e2f335e1 | 58 | } |
musallambseiso | 8:b8e8e2f335e1 | 59 | else if (collisions >= 5) |
musallambseiso | 8:b8e8e2f335e1 | 60 | { |
musallambseiso | 8:b8e8e2f335e1 | 61 | } |
musallambseiso | 8:b8e8e2f335e1 | 62 | } |