aboutsummaryrefslogtreecommitdiffstats
path: root/main.cpp
diff options
context:
space:
mode:
authordrumsetmonkey <abelleisle@roadrunner.com>2015-12-08 22:36:39 -0500
committerdrumsetmonkey <abelleisle@roadrunner.com>2015-12-08 22:36:39 -0500
commit23e8deda4bb0ea5a6962a1cfbfd35bc46a8c8b8d (patch)
tree311f9edbd5ef8943ffd99eba890dc14a7896d3fc /main.cpp
parent2a058ec5eb5cbbc4c95832507fc7b8426a2bcc2c (diff)
Made swords work facing both directions
Diffstat (limited to 'main.cpp')
-rw-r--r--main.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/main.cpp b/main.cpp
index fc2fb6c..d1fd85e 100644
--- a/main.cpp
+++ b/main.cpp
@@ -703,11 +703,6 @@ void render(){
glUseProgramObjectARB(0);
}
player->inv->draw();
-
- if(player->inv->usingi && player->inv->detectCollision(vec2{currentWorld->npc[0]->loc.x, currentWorld->npc[0]->loc.y},vec2{currentWorld->npc[0]->loc.x+currentWorld->npc[0]->width,currentWorld->npc[0]->loc.y+currentWorld->npc[0]->height})){
- currentWorld->npc[0]->alive = false;
- }
-
/*
* Here we draw a black overlay if it's been requested.
@@ -839,6 +834,10 @@ void logic(){
*/
if(n->canMove) n->wander((rand() % 120 + 30));
+
+ if(player->inv->usingi && player->inv->detectCollision(vec2{n->loc.x, n->loc.y},vec2{n->loc.x+n->width,n->loc.y+n->height})){
+ n->alive=false;
+ }
/*
* Don't bother handling the NPC if another has already been handled.
*/