Untitled

mail@pastecode.io avatar
unknown
plain_text
a month ago
850 B
1
Indexable
Never
if (Engine::Collider::IsCircleOverlap(this->Position, this->CollisionRadius / 20, it->Position,
                                               enemy->CollisionRadius / 20)) {
             for (auto &it: scene->EnemyGroup->GetObjects()) {
                 Enemy *enemy = dynamic_cast<Enemy *>(it);
                 if (Engine::Collider::IsCircleOverlap(this->Position, this->CollisionRadius / 20, it->Position,
                                                       enemy->CollisionRadius / 20)) {
                     enemy->collideplant = true;
                     if (Position.x - it->Position.x > 40 && Position.x - it->Position.x < 45) {
                         Hit(enemy->hp);
                         enemy->collideplant = false;
                     }
                     return;
                 }

             }
         }
Leave a Comment