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
Bat/Bat.cpp@22:69d7fe739872, 2019-04-30 (annotated)
- Committer:
- shahidsajid
- Date:
- Tue Apr 30 20:36:42 2019 +0000
- Revision:
- 22:69d7fe739872
- Parent:
- 21:a0904159e183
Completed version of the game;
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| shahidsajid | 4:55a0509c4874 | 1 | #include "Bat.h" |
| shahidsajid | 4:55a0509c4874 | 2 | |
| shahidsajid | 4:55a0509c4874 | 3 | |
| shahidsajid | 4:55a0509c4874 | 4 | Bat::Bat() |
| shahidsajid | 4:55a0509c4874 | 5 | { |
| shahidsajid | 4:55a0509c4874 | 6 | |
| shahidsajid | 4:55a0509c4874 | 7 | } |
| shahidsajid | 4:55a0509c4874 | 8 | |
| shahidsajid | 4:55a0509c4874 | 9 | Bat::~Bat() |
| shahidsajid | 4:55a0509c4874 | 10 | { |
| shahidsajid | 4:55a0509c4874 | 11 | |
| shahidsajid | 4:55a0509c4874 | 12 | } |
| shahidsajid | 4:55a0509c4874 | 13 | void Bat::init(int x,int y) |
| shahidsajid | 6:3e50f2cf4366 | 14 | { |
| shahidsajid | 6:3e50f2cf4366 | 15 | batPad.init(); |
| shahidsajid | 4:55a0509c4874 | 16 | _x = 42; |
| shahidsajid | 4:55a0509c4874 | 17 | _y = 15; |
| shahidsajid | 6:3e50f2cf4366 | 18 | _hitBall=0; |
| shahidsajid | 21:a0904159e183 | 19 | |
| shahidsajid | 4:55a0509c4874 | 20 | } |
| shahidsajid | 13:924891519a95 | 21 | void Bat::reset(){ |
| shahidsajid | 13:924891519a95 | 22 | _hitBall=0; |
| shahidsajid | 13:924891519a95 | 23 | _loft_ball=0; |
| shahidsajid | 13:924891519a95 | 24 | } |
| shahidsajid | 4:55a0509c4874 | 25 | void Bat::draw(N5110 &lcd){ |
| shahidsajid | 4:55a0509c4874 | 26 | lcd.drawLine(38,36,41,36,1); |
| shahidsajid | 4:55a0509c4874 | 27 | lcd.drawRect(41,35,6,3,FILL_BLACK); |
| shahidsajid | 12:954da4f4e565 | 28 | //ball1.draw(); |
| shahidsajid | 4:55a0509c4874 | 29 | } |
| shahidsajid | 21:a0904159e183 | 30 | int Bat::get_hitBall(UX &ux){ |
| shahidsajid | 21:a0904159e183 | 31 | _hitBall=ux.get_a_pressed(); |
| shahidsajid | 6:3e50f2cf4366 | 32 | return _hitBall; |
| shahidsajid | 6:3e50f2cf4366 | 33 | } |
| shahidsajid | 21:a0904159e183 | 34 | int Bat::get_loft_ball(UX &ux){ |
| shahidsajid | 22:69d7fe739872 | 35 | _loft_ball=ux.get_l_pressed(); |
| shahidsajid | 13:924891519a95 | 36 | return _loft_ball; |
| shahidsajid | 21:a0904159e183 | 37 | } |