diff options
author | Clyne Sullivan <tullivan99@gmail.com> | 2015-09-30 07:30:23 -0400 |
---|---|---|
committer | Clyne Sullivan <tullivan99@gmail.com> | 2015-09-30 07:30:23 -0400 |
commit | 14ccfd08584574d4ac2f9ce0c152e50b74b961f9 (patch) | |
tree | 1ecde142697832dc5e2b0399984aaeab444c2344 | |
parent | ae3db38b6eb21abd9f0db88793de77b50f88d4ef (diff) | |
parent | 5cee9e29459e095ac0871ca2a662fd5fd4e599dc (diff) |
updates
-rw-r--r-- | src/main.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main.cpp b/src/main.cpp index 4fb66d3..7980cf7 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -213,8 +213,8 @@ void logic(){ for(int i=0;i<=entity.size();i++){ if(entity[i]->alive&&entity[i]->type == NPCT){ entity[i]->wander((rand()%120 + 30), &entity[i]->vel); - if( pow((entity[i]->loc.x - player->loc.x),2) + pow((entity[i]->loc.y - player->loc.y),2) <= pow(30*HLINE,2)){ - if(mx >= entity[i]->loc.x && mx <= entity[i]->loc.x + entity[i]->width && my >= entity[i]->loc.y && my <= entity[i]->loc.y + entity[i]->width) + if( pow((entity[i]->loc.x - player->loc.x),2) + pow((entity[i]->loc.y - player->loc.y),2) <= pow(35*HLINE,2)){ + if(mx >= entity[i]->loc.x && mx <= entity[i]->loc.x + entity[i]->width && my >= entity[i]->loc.y && my <= entity[i]->loc.y + entity[i]->width && (SDL_GetMouseState(NULL, NULL) & SDL_BUTTON(SDL_BUTTON_RIGHT))) entity[i]->interact(); } } |