aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClyne Sullivan <tullivan99@gmail.com>2015-09-30 07:29:50 -0400
committerClyne Sullivan <tullivan99@gmail.com>2015-09-30 07:29:50 -0400
commitae3db38b6eb21abd9f0db88793de77b50f88d4ef (patch)
treed0ba85a6949c33421635d37e25380b615527741e
parent4031320180ff5e6c6452fc58575f5d7eac8eddbe (diff)
updates
-rw-r--r--Changelog2
-rw-r--r--src/main.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/Changelog b/Changelog
index 4ac0ba4..cd04cf6 100644
--- a/Changelog
+++ b/Changelog
@@ -43,4 +43,4 @@
- made world handling work with interpolation
- successfully ran game 200 entities
- improved debug screen
-
+ - added mouse interaction w/ NPCs
diff --git a/src/main.cpp b/src/main.cpp
index 6c4047c..4fb66d3 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -213,7 +213,7 @@ 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(40,2)){
+ 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)
entity[i]->interact();
}