Advertisement
keysle

Untitled

May 12th, 2012
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. Bomb::Bomb() {
  2. x = 0.0;
  3. bombClockTime = 10;
  4. flightTime = 0;
  5. }
  6.  
  7. Bomb::Bomb(double _x, int _bombClockTime, int _flightTime) {
  8. x = _x;
  9. bombClockTime = _bombClockTime;
  10. flightTime = _flightTime;
  11. }
  12.  
  13. void Bomb::fly(double speed) {
  14. x += speed;
  15. flightTime++;
  16.  
  17. if (flightTime >= bombClockTime){
  18. blowUp();
  19. }
  20. }
  21.  
  22.  
  23.  
  24. //---------------------
  25. #ifndef POINT_H
  26. #define POINT_H
  27.  
  28. class Bomb {
  29. public:
  30. void fly(double speed);
  31. void blowUp();
  32. double x;
  33. int bombClockTime;
  34. int flightTime;
  35. };
  36.  
  37. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement