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
spase_ship/space_ship.cpp@85:0094d33fb1da, 2019-04-28 (annotated)
- Committer:
- fy14lkaa
- Date:
- Sun Apr 28 14:50:01 2019 +0000
- Revision:
- 85:0094d33fb1da
- Parent:
- 84:d875c6e87398
- Child:
- 86:79cfe806a11d
setting up the parameters of the spaceship in void initialization function.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
fy14lkaa | 83:a55e77dfee5a | 1 | #include "space_ship.h" |
fy14lkaa | 83:a55e77dfee5a | 2 | |
fy14lkaa | 83:a55e77dfee5a | 3 | space_ship::space_ship() |
fy14lkaa | 83:a55e77dfee5a | 4 | { |
fy14lkaa | 83:a55e77dfee5a | 5 | |
fy14lkaa | 83:a55e77dfee5a | 6 | } |
fy14lkaa | 83:a55e77dfee5a | 7 | |
fy14lkaa | 83:a55e77dfee5a | 8 | space_ship::~space_ship() |
fy14lkaa | 83:a55e77dfee5a | 9 | { |
fy14lkaa | 83:a55e77dfee5a | 10 | |
fy14lkaa | 83:a55e77dfee5a | 11 | } |
fy14lkaa | 84:d875c6e87398 | 12 | |
fy14lkaa | 85:0094d33fb1da | 13 | void space_ship::init(int x,int height,int width) |
fy14lkaa | 85:0094d33fb1da | 14 | { |
fy14lkaa | 85:0094d33fb1da | 15 | _x = x; // x value on screen is fixed |
fy14lkaa | 85:0094d33fb1da | 16 | _y = HEIGHT/2 - height/2; // y depends on height of screen and height of space_ship |
fy14lkaa | 85:0094d33fb1da | 17 | _height = height; |
fy14lkaa | 85:0094d33fb1da | 18 | _width = width; |
fy14lkaa | 85:0094d33fb1da | 19 | _speed = 1; // default speed |
fy14lkaa | 85:0094d33fb1da | 20 | _score = 0; // start score from zero |
fy14lkaa | 85:0094d33fb1da | 21 | |
fy14lkaa | 85:0094d33fb1da | 22 | } |