Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Bomb::Bomb() {
- x = 0.0;
- bombClockTime = 10;
- flightTime = 0;
- }
- Bomb::Bomb(double _x, int _bombClockTime, int _flightTime) {
- x = _x;
- bombClockTime = _bombClockTime;
- flightTime = _flightTime;
- }
- void Bomb::fly(double speed) {
- x += speed;
- flightTime++;
- if (flightTime >= bombClockTime){
- blowUp();
- }
- }
- //---------------------
- #ifndef POINT_H
- #define POINT_H
- class Bomb {
- public:
- void fly(double speed);
- void blowUp();
- double x;
- int bombClockTime;
- int flightTime;
- };
- #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement