Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/Seagull/Bird.cpp b/Seagull/Bird.cpp
- index 5553f2e..a60826d 100644
- --- a/Seagull/Bird.cpp
- +++ b/Seagull/Bird.cpp
- @@ -4,12 +4,14 @@ Bird::Bird(string textureFile, Vector2f point, Vector2f speed) : Entity(textureF
- {
- texture.loadFromFile(textureFile);
- sprite.setTexture(texture);
- - sprite.setTextureRect(IntRect(0, 14, 94, 72)); // получили нужный прямоугольник
- + sprite.setTextureRect(IntRect(0, 14, 94, 72)); // получили нужный прямоугольник
- act = 2;
- stage = 0.5;
- active = true;
- - HP = 60; // хп птички
- + HP = 100; // хп птички
- +
- + explosionScale = 1.5f;
- }
- @@ -23,12 +25,14 @@ void Bird::update(Time elapsed) {
- if (active) {
- - HP -= 0.01;// время жизни, птички зависящее от хп, изменять тут
- + HP -= 35*elapsed.asSeconds(); // время жизни, птички зависящее от хп, изменять тут
- act -= 3* (elapsed.asSeconds());
- if (point.x < 5 or point.x>900)
- speed.x *= -1;
- + if (point.y < 5 or point.y>600)
- + speed.y *= -1;
- if (act <= stage) {
- diff --git a/Seagull/Bird.h b/Seagull/Bird.h
- index 79aa111..b8474aa 100644
- --- a/Seagull/Bird.h
- +++ b/Seagull/Bird.h
- @@ -10,9 +10,6 @@ public:
- Bird(string textureFile, Vector2f point, Vector2f speed);
- virtual void update(Time elapsed);
- virtual ColType getColType();
- - float explosionTimer = 1;
- - /*float explosionScale = 2;*/
- - float explosionStages[4];
- float act;
- float stage;
- diff --git a/Seagull/Enemy.cpp b/Seagull/Enemy.cpp
- index 3993b31..9360f3a 100644
- --- a/Seagull/Enemy.cpp
- +++ b/Seagull/Enemy.cpp
- @@ -48,13 +48,14 @@ void Enemy::Shoot()
- void Enemy::onDeath()
- {
- //птичка
- - Vector2f centerEnemy = getSpriteCenter();
- - centerEnemy.x -= 45;
- - centerEnemy.y -= 45;
- - float xr = (-100 + rand() % 100);
- - float yr = (10 + rand() % 50);
- - generated.push_back(new Bird("bird.png", centerEnemy, Vector2f(xr, yr)));
- -
- + if (rand() % 100 > 50) {
- + Vector2f centerEnemy = getSpriteCenter();
- + centerEnemy.x -= 45;
- + centerEnemy.y -= 45;
- + float xr = (-1000 + rand() % 2000);
- + float yr = (-1000 + rand() % 2000);
- + generated.push_back(new Bird("bird.png", centerEnemy, Vector2f(xr, yr)));
- + }
- }
- Enemy::ColType Enemy::getColType()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement