| 357 | } |
| 358 | |
| 359 | void LevelDebugLayer::updateTriggers(float dt) |
| 360 | { |
| 361 | int current_section = sectionForPos(Camera::getDefaultCamera()->getPositionX()); |
| 362 | |
| 363 | for (int i = current_section - 3; i < current_section + 1; i++) |
| 364 | { |
| 365 | if (i < _sectionObjects.size() && i >= 0) |
| 366 | { |
| 367 | std::vector<GameObject*> section = _sectionObjects[i]; |
| 368 | |
| 369 | for (int j = 0; j < section.size(); j++) |
| 370 | { |
| 371 | GameObject* obj = section[j]; |
| 372 | if (obj->isActive() && obj->_isTrigger) |
| 373 | { |
| 374 | auto trigger = dynamic_cast<EffectGameObject*>(obj); |
| 375 | if (!trigger->_spawnTriggered && |
| 376 | trigger->getPositionX() <= Camera::getDefaultCamera()->getPositionX()) |
| 377 | { |
| 378 | trigger->triggerActivated(dt); |
| 379 | } |
| 380 | } |
| 381 | } |
| 382 | } |
| 383 | } |
| 384 | } |
| 385 | |
| 386 | void LevelDebugLayer::reorderLayering(GameObject* parentObj, ax::Sprite* child) |
| 387 | { |
nothing calls this directly
no test coverage detected