Advertisement
Guest User

diff

a guest
Dec 19th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.49 KB | None | 0 0
  1. diff --git a/Seagull/Bird.cpp b/Seagull/Bird.cpp
  2. index 5553f2e..a60826d 100644
  3. --- a/Seagull/Bird.cpp
  4. +++ b/Seagull/Bird.cpp
  5. @@ -4,12 +4,14 @@ Bird::Bird(string textureFile, Vector2f point, Vector2f speed) : Entity(textureF
  6. {
  7. texture.loadFromFile(textureFile);
  8. sprite.setTexture(texture);
  9. - sprite.setTextureRect(IntRect(0, 14, 94, 72)); // получили нужный прямоугольник
  10. + sprite.setTextureRect(IntRect(0, 14, 94, 72)); // получили нужный прямоугольник
  11.  
  12. act = 2;
  13. stage = 0.5;
  14. active = true;
  15. - HP = 60; // хп птички
  16. + HP = 100; // хп птички
  17. +
  18. + explosionScale = 1.5f;
  19.  
  20. }
  21.  
  22. @@ -23,12 +25,14 @@ void Bird::update(Time elapsed) {
  23.  
  24. if (active) {
  25.  
  26. - HP -= 0.01;// время жизни, птички зависящее от хп, изменять тут
  27. + HP -= 35*elapsed.asSeconds(); // время жизни, птички зависящее от хп, изменять тут
  28. act -= 3* (elapsed.asSeconds());
  29.  
  30.  
  31. if (point.x < 5 or point.x>900)
  32. speed.x *= -1;
  33. + if (point.y < 5 or point.y>600)
  34. + speed.y *= -1;
  35.  
  36. if (act <= stage) {
  37.  
  38. diff --git a/Seagull/Bird.h b/Seagull/Bird.h
  39. index 79aa111..b8474aa 100644
  40. --- a/Seagull/Bird.h
  41. +++ b/Seagull/Bird.h
  42. @@ -10,9 +10,6 @@ public:
  43. Bird(string textureFile, Vector2f point, Vector2f speed);
  44. virtual void update(Time elapsed);
  45. virtual ColType getColType();
  46. - float explosionTimer = 1;
  47. - /*float explosionScale = 2;*/
  48. - float explosionStages[4];
  49.  
  50. float act;
  51. float stage;
  52. diff --git a/Seagull/Enemy.cpp b/Seagull/Enemy.cpp
  53. index 3993b31..9360f3a 100644
  54. --- a/Seagull/Enemy.cpp
  55. +++ b/Seagull/Enemy.cpp
  56. @@ -48,13 +48,14 @@ void Enemy::Shoot()
  57. void Enemy::onDeath()
  58. {
  59. //птичка
  60. - Vector2f centerEnemy = getSpriteCenter();
  61. - centerEnemy.x -= 45;
  62. - centerEnemy.y -= 45;
  63. - float xr = (-100 + rand() % 100);
  64. - float yr = (10 + rand() % 50);
  65. - generated.push_back(new Bird("bird.png", centerEnemy, Vector2f(xr, yr)));
  66. -
  67. + if (rand() % 100 > 50) {
  68. + Vector2f centerEnemy = getSpriteCenter();
  69. + centerEnemy.x -= 45;
  70. + centerEnemy.y -= 45;
  71. + float xr = (-1000 + rand() % 2000);
  72. + float yr = (-1000 + rand() % 2000);
  73. + generated.push_back(new Bird("bird.png", centerEnemy, Vector2f(xr, yr)));
  74. + }
  75. }
  76.  
  77. Enemy::ColType Enemy::getColType()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement