void TriggerComponent::update() { _obj->sprite->setTileIndex( tileEnable + (_animCounter / animSpeed) % animCount); Boxf pBox = _state->player()->worldBox(); Boxf wBox = _obj->worldBox(); if(!hitPoint.empty()) { Vec2 point = wBox.min() + pointCoords; if(pBox.contains(point)) { _state->exec(hitPoint.c_str()); } } if(!hit.empty()) { if(!pBox.intersection(wBox).isEmpty()) { _state->exec(hit.c_str()); } } bool doUse = _state->input().justPressed(_state->useInput()); if(!use.empty() && doUse) { Vec2 usePoint = pBox.center(); if(wBox.contains(usePoint)) { _state->exec(use.c_str()); } } ++_animCounter; }